What Is CSS And How To Use It

Posted by TotalDC

Previously I talked about HTML (Hypertext Markup Language), a coding language that is the foundation for all web development. If HTML is the first language to learn when starting to build websites, then CSS goes after it. In This article let’s find out what is CSS and how to use it.

What is CSS?

CSS stands for Cascading Style Sheets with an emphasis placed on “Style”. While HTML is used to structure web documents, CSS specifies your document’s style – page layouts, colors, and fonts are all determined with CSS.

How Does CSS Work?

CSS brings style to your website by interacting with HTML elements. As you know elements are the individual HTML components of a web page like a paragraph.

<p>This is my paragraph</p>

For example, you can make this paragraph appear red to people viewing your website through a web browser. Then you need to use CSS code which looks like this

p  {  color:red; }

Here “p” is called the “selector”—it’s the part of CSS code specifying which HTML element the CSS styling will affect. In CSS, the selector is written to the left of the first curly bracket. The information between curly brackets is called a declaration, and it contains properties and values that are applied to the selector. The full bracketed set

{  color:red; }

is the declaration. These same basic principles can be applied to change font sizes, background colors, margin indentations, and more.