Monday, 8 February 2021

Cascading Style Sheets

 Css

CSS stands for Cascading Style Sheets.css describes how html elements are to be displayed on screen, paper, or in other media.Css saves a lot of work. It can control the layout of multiple web pages all at once.


Css has 3 types

1.Inline:-Add a style line by Line(directly in html)

2.Internal:-Add style in body

3.External:-Linking external css file


Css Syntax



ex:-p {

  text-align: center;}

p is a selector

text-align is a property, and center is the property value

Css selectors

CSS selectors are used to "find" the HTML elements you want to style.

  • Simple selectors:-
 Selects HTML elements based on the element name
The id attribute of an HTML element to select a specific element.
  • Combinator selectors 
(select elements based on a specific relationship between them)
  •  class selectors(select elements based on a certain state)
The id selector uses the id attribute of an HTML element to select a specific element.
  • Pseudo element selectors (select and style a part of an element)
html tags selected by html element
  • Attribute selector (select elements based on an attribute or attribute value)
The Attribute selector uses the  attribute of an HTML element to select a specific element.


No comments:

Post a Comment