What is CSS? How to use it?

Cascading Style Sheets (CSS) is a language that shows how a document can be displayed or straightforward to control the style of the document. But if we want to create a good quality website, then CSS is needed. Cascading Style Sheets How to show different elements of an HTML file, such as color, font size, margin, padding, etc. are defined by CSS.

There are three ways to add CSS to HTML:

  1. External style sheet
  2. Internal style sheet
  3. Inline style …

1.External style sheet
An external style sheet is used to add the same style to more than one HTML file. All the websites we visit, all created with the External style sheet. With the help of External style sheet, the style or style of all the web pages at the same time. Which reduces many jobs. By creating a CSS file, all the styles are written in that CSS file. Then it was added to the HTML file.
To add the external style sheet to HTML file, the head tag is written as follows.

Create a file. Name the style.css and save the code below and save it.
.div {
 background: url(../img/ima01.jpgno-repeatcentercenterfixed;
2.Internal Style Sheet
Internal Style Sheet is used to give style to a specific HTML file. If you use the Internal Style Sheet, you will have to enter the CSS code separately for all the web pages. Internal Style Sheet and Web page / HTML page head tag to be written in. For this, the CSS code is written in another tag named ‘style’ in the head tag. Internal Style Sheet is written in an HTML file as follows.
   .div {background:#cccccc;}
   h1 {color:#c2c2c2;}
3.Inline Styles
Inline Styles is used to giving a specific element style to HTML. Although it is not a good way to style HTML files. Inline Styles inside an HTML tag are written as below
<h4style="color:red; font-size:25px">This is a heading.</h4>
<p style="color:green; font-size:14px">This is a paragraph.</p>
<h6style="color:black; font-size:18px">This is a sub heading.</h6

1 thought on “What is CSS? How to use it?”

  1. Wow! This blog looks exactly like my old one! It’s on a entirely different subject but it has pretty much the same page layout and design. Wonderful choice of colors!

Leave a Comment