Colors, Fonts, and Text Styling in CSS
When building a website, layout is important — but colors, fonts, and text styling are what give your site personality and readability. CSS allows you to control how text looks and feels, making your web pages more attractive and user-friendly. In this blog, we’ll cover the basics of colors, fonts, and text styling in CSS , with simple examples that beginners can easily understand. Using Colors in CSS Colors in CSS can be applied to: Text Backgrounds Borders Links and buttons 1. Text Color You can change text color using the color property. p { color : blue; } 2. Background Color To change the background color of an element: div { background-color : lightgray; } Ways to Define Colors in CSS CSS supports multiple color formats: Color names – red , blue , green HEX values – #ff5733 RGB – rgb(255, 87, 51) RGBA – rgba(255, 87, 51, 0.5) (adds transparency) Beginners often start with color names and HEX values. Fonts in CSS Fonts...