What is CSS and How to use CSS?

Posted by

Cascading style sheets (css) is a style sheet language used for describing the look and formatting of a document written in markup language,  It provides an additional feature to HTML. It is generally used with HTML to change the style of web pages and user interfaces.

SYNTAX

Selector{Property1: value1; Property2: value2; ..........;}  

What does CSS do

  • You can add new looks to your old HTML documents.
  • You can completely change the look of your website with only a few changes in CSS code.

Why use CSS

CSS is used to define styles for your web pages, including the design, layout and variations in display for different devices and screen sizes.

  • Solves a big problem
  • Saves a lot of time
  • Provide more attributes
  • Selector : Selector indicates the HTML element you want to style. It could be any tag like <h1>, <title> etc.
  • Declaration Blog: The declaration block can contain one or more declarations separated by a semicolon. 
  • Property:A Property is a type of attribute of HTML element. It could be color, border etc.
  • Value: Values are assigned to CSS properties. In the above example, value “yellow” is assigned to color property.
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x