CSS (Cascading Style Sheets):
CSS is a simple designing language intended to ease the process of making web pages feel good & make it more presentable. CSS is a language that describes the style of an HTML document.
It describes how HTML elements should be displayed.
CSS handles the look of a web page. Using CSS, you can control the color of the text, the style of fonts, the spacing between paragraphs, how columns are sized and laid out, what background images or colors are used, as well as a variety of other effects.
CSS is easy to learn and understand. It provides a great control over the presentation of an HTML document. Most commonly, CSS is combined with the markup languages HTML or XHTML. CSS saves a lot of work. It can control the layout of multiple web pages all at once.
In simpler words, HTML displays the content & CSS provide the layout to that content.
The syntax of CSS is quite simple :
Selector{
property: value;
}
Explanation:
The selector points out to the HTML element you want to style.
The property of the HTML element can be anything like its background-color, text-color, font-size, font-family, etc.
There can be multiple property & value pairs inside the curly{} brackets.
Example:
h1 {
color: blue;
font-size: 16px;
}
Here the example denotes that the h1 tag wants a text color of blue & the size of the font should be 16px.
Ways to add CSS to your HTML file:
1. External CSS:
In this case, the css file is prepared externally & linked to the HTML document via a link.
<link rel="stylesheet" type="text/css" href="mystyle.css">
2. Internal CSS:
In this case, the css code is written in between the <style> </style> tags. These style tags are placed in between the head section of the HTML document.
<style>
p{color: red;}
</style>
3. Inline CSS:
Inline CSS is declared on the same line where the HTML code is written.
<p style="color:red;">This is a paragraph.</p>
Happy Learning!
CSS is a simple designing language intended to ease the process of making web pages feel good & make it more presentable. CSS is a language that describes the style of an HTML document.
It describes how HTML elements should be displayed.
CSS handles the look of a web page. Using CSS, you can control the color of the text, the style of fonts, the spacing between paragraphs, how columns are sized and laid out, what background images or colors are used, as well as a variety of other effects.
CSS is easy to learn and understand. It provides a great control over the presentation of an HTML document. Most commonly, CSS is combined with the markup languages HTML or XHTML. CSS saves a lot of work. It can control the layout of multiple web pages all at once.
In simpler words, HTML displays the content & CSS provide the layout to that content.
The syntax of CSS is quite simple :
Selector{
property: value;
}
Explanation:
The selector points out to the HTML element you want to style.
The property of the HTML element can be anything like its background-color, text-color, font-size, font-family, etc.
There can be multiple property & value pairs inside the curly{} brackets.
Example:
h1 {
color: blue;
font-size: 16px;
}
Here the example denotes that the h1 tag wants a text color of blue & the size of the font should be 16px.
Ways to add CSS to your HTML file:
1. External CSS:
In this case, the css file is prepared externally & linked to the HTML document via a link.
<link rel="stylesheet" type="text/css" href="mystyle.css">
2. Internal CSS:
In this case, the css code is written in between the <style> </style> tags. These style tags are placed in between the head section of the HTML document.
<style>
p{color: red;}
</style>
3. Inline CSS:
Inline CSS is declared on the same line where the HTML code is written.
<p style="color:red;">This is a paragraph.</p>
Happy Learning!
No comments:
Post a Comment
Comments