Glimpse Of Css

Glimpse Of Css


2 min read

On 10th October 1994,CSS-Cascading style sheets was first proposed by Hakon Wium Lie. As HTML grew , CSS provided a wider option and this evolution gave more flexibility to the developers in controling the appearance of the site .

W3C-world wide web consortium recommended and released CSS -1 on 17th December 1996 1.webp

Cascading Style sheets(CSS) is a style sheet which describes the layout and design of the appearance and presentation of a web page which assists markup languages such as HTML or XML.CSS converts an off looking HTML page into a constructive and responsive website and it is a very demanding skill which offers you to customize your own build page.
Production of the car is incomplete without giving it an exterior look with paint, similarly css functions in a manner which completes the design and appearances of the page. You would rather potray it in a way that HTML is incomplete without CSS.


There are 3 ways to add CSS to HTML :-

  1. Style tag - Adding style tag directly to HTML.

  2. Inline CSS - Adding CSS using style attribute.

  3. External CSS - Adding a stylesheet(.css) to HTML using link tag.

Personally, I will go for External CSS as it provides you a systematic and constructive coding format.There will be a seperate coding file which makes it easier to insert ,delete or add any styling, you just have to connect it with HTML ,with a link tag.

  1. Element Selector- It is used to select an element based off the tag name.

    for example-  h2{ color : white; }
    This sets the color of element "h2" as white .
  2. Id Selector-It is used to select an element with a given id. Hash is used to target id.

    for example -   #first{ background color : aqua; }
    This sets the background color of the targeted id to aqua. 
  3. Class Selector-Select an element with a given class. Fullstop is used to target class.

     for example - .second{ border : 2px solid black; }
     This sets the border of the class to solid black of width 2px.

Different attributes you can add : Color , background color , border , height ,width margin ,padding ,text-decoration ,text-transform ,font size ,font-family and more.

Did you find this article valuable?

Support TechLearn India by becoming a sponsor. Any amount is appreciated!