Introduction to CSS

Introduction to CSS | Web Development

In this article, we will learn about the introduction to CSS. Previously we have completed the whole HTML that is required for building our web pages and now we’ll learn how to design those HTML pages with the help of CSS.

Cascading Style Sheets is abbreviated as CSS. It is used to give style to web pages and it describes how the HTML elements are been displayed on the web page.

It is also used to make web pages responsive. A web page is called responsive if it works properly on any device and adopts any screen size without any issue.

Let’s take a simple example to understand what is CSS and how it works. Assume a car and compare it with our web pages, if the body or the metallic structure of the car is HTML. Then the color, design, and positioning of every part in the car are CSS and the engine of the car that makes it dynamic is our JavaScript.

Syntax of CSS:

Div {
     Color: Red;
     Border: 2px solid blue;
     }
Introduction to CSS: Syntax of CSS
  • Selector: the selector is the HTML element that we want to style. we can also use groups of selectors if we want to add the same style to the group.
  • Deceleration Box: The deceleration box is where all the properties and values are been declared and separated from each other by semicolons. Each deceleration has a property and value which is separated by a colon. The deceleration box starts and ends with curly braces.
  • Property: It is the aspect of the selector which we want to change.
  • Value: It is what the property will be changed to.

So after the syntax, the next thing is How can we use CSS on our HTML pages?

So basically, there are 3 ways by which we can add CSS or styling to our web pages that are:

  • Inline CSS
  • Internal CSS
  • External CSS

We will learn about these ways in detail in our next article as in this article we only have an introduction to CSS.

This Post Has One Comment

Leave a Reply