Starting with CSS

Starting with CSS

1;- what is CSS and why use it?

Ans:-Cascading style sheets(CSS) are used to style and layout web pages. Ilke for color, font, size and spacing of your content.

2:-what are the different ways to bring CSS into an HTML file?

Ans:- we can add CSS to our projects in the following ways:-

(i);- Inline styling

(ii):- Internal styling

(iii):- External styling

3:-what do you mean by specificity in CSS?

Ans:- if two or more CSS rules are pointing to the same element, the selector with the highest specificity values will win and its style declaration will be applied to the HTML element.

In this example, we have added an inline style for the "p" element. The text will now be pink because the inline style is given the highest priority:

<html>
<head>
<style>

#demo {color: blue;}  
.test {color: green;}  
p {color: red;}  

</style>
</head>
<body>

<p id="demo" class="test" style="color: pink;">Hello World!</p>

</body>
</html>