ARCADIS IS HIRING!!! Company : Arcadia Position : Software Engineer Experience : Bs/Ms Degree : BS in CS Apply Link: Apply Here
What is CSS?
- CSS stands for Cascading Style Sheets.
- CSS describes how HTML elements are to be displayed on screen, paper, or in other media.
- CSS saves a lot of work. It can control the layout of multiple web pages all at once.
- External style sheets are stored in CSS files.
Syntax:-
<h1> {color:blue; font-size:12px; } </h1>
h1 is a selector part.
color is the property.
blue is the value.
{} is used for the declaration part, where we can pass the property and the value.
Example:-
p {
color: red;
text-align: center;
}
color: red;
text-align: center;
}
In the above example all the lines which cointains the paragraph tag will change.
The CSS id Selector
- The id selector uses the id attribute of an HTML element to select a specific element.
- The id of an element is unique within a page, so the id selector is used to select one unique element!
- To select an element with a specific id, write a hash (#) character, followed by the id of the element.
Example:-
#paragraph {
text-align: center;
color: red;
}
text-align: center;
color: red;
}
In this there is one id name "paragraph" in that the all the changes will be happen and all the others tag will remain the same.
How To Add CSS
There are three ways to add CSS namely:-
- External CSS.
- Internal CSS.
- Inline CSS.
External CSS
With an external style sheet, you can change the look of an entire website by changing just one file!
Each HTML page must include a reference to the external style sheet file inside the <link> element, inside the head section.
Internal CSS
An internal style sheet may be used if one single HTML page has a unique style.The internal style is defined inside the <style> element, inside the head section.
Inline CSS
An inline style may be used to apply a unique style for a single element.
To use inline styles, add the style attribute to the relevant element. The style attribute can contain any CSS property.

Comments
Post a Comment