Learn CSS ID And Class

Css Id And Class

Id addition style setting for a html document.CSS allows you to definy your on selector called CSS  'Id' and 'Class' .
The Id Selector:

1. The id selector is used to definy a style for single, unique element.


2. The id selector uses the id attribute of the HTML element, and is defined with a "#".



3. The style rule below will be applied to the element with id="para1":
Example:
At frist open your notepad and type the code show in the picture..
Or,
<!DOCTYPE html>
<html>
<head>
<style>
#para1
{
text-align:center;
color:red;
}
</style>
</head>

<body>
<p id="para1">Hello Friens</p>
<p>This paragraph is not affected by the style.</p>
</body>
</html>
Coppy the code and paste notepad and then save the file htm format..Now open the html file on your browser and see like this picture..
Learn more css pls see the next css post.The tutorial post by web tutorials and webtutorial4.....


 


Next Post Previous Post
No Comment
Add Comment
comment url