WDD - Cascading Style Sheets
WDD - Cascading Style Sheets
Development
LESSON [5] –CSS - CASCADING STYLE SHEETS
</style>
</head>
CSS WEBSITE DESIGN & DEVELOPMENT
The id Selector
The id selector uses the id attribute of an HTML element to select a specific element.
The id of an element should be 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.
The style rule below will be applied to the HTML element with id="para1":
#para1 {
text-align: center;
color: red;
}
Example
.center {
text-align: center;
color: red;
}
p.center {
text-align: center;
color: red;
}
Class 1= center
Class 2= large
HTML Sheet
Save this as name.htm
CSS sheet
(Save this as mystyle.css)
So, an inline style (inside a specific HTML element) has the highest priority,
which means that it will override a style defined inside the <head> tag, or in an
external style sheet, or a browser default value.
background-image: url("background-wallpapers-34.jpg");
Styling Links
The End..!!