Essentially, CSS (cascading style sheets) is all about decorating the material we produce in HTML and simply adding some visual styles to it. Another fundamental web technology is CSS. 


While HTML formerly essentially defined the material of a page, On the other hand, we utilize CSS to specify the visual style and the presentation of the content.
CSS basically describes the layout and visual style of that complete content.


A lot of various components make up HTML, which we can employ to define the material. While CSS is made up of many different characteristics we programmers may employ to style the material.


These features let us customize various aspects of the typeface, the text, the overall spacing, the page layout, and so on.
 

 

 

Parts of CSS Style

 

All this together, so basically the selector plus the declaration block is what we call a CSS rule. where we select all of our elements and style them in any way that we want.

 

 

 

There are three places where we can write CSS,

 

  • Inline CSS
    • Writing the CSS code inside essentially of the element.
    • However, inline styles should usually never be used
    • CSS limited to this H1 Element only

 

 

  • Internal CSS
    • declare a style element inside Head Element.
    • Applies to all H1 element on this page
    • We decoupled the style, which applies to all H1 element of this page

 

 

  • External CSS
    • Above 2 modes should be avoided. never a good thing in programming. We want to keep these things in separate places, call it the separation of concerns.
    • Add URL of separate CSS file  
    • This can be a local CSS or an external CSS file

 


Related Question