| Page 1 of 1 | [ 5 posts ] |
|
Hello,
Can i know the roll of class in CSS? How can it use? Please anyone help me. |
|
There are many web sites devoted to explaining CSS. Here is one: http://www.w3schools.com/css/default.asp
|
|
The class in CSS is used to specify a style for a group of elements. If you don't like the id selector, the class selector is most often used on several elements.
Example <p class="test">wedqw qwd qwdq qwd qwd qwd qw</p> |
|
I agree with Johan its really easy here i can give an example to:
Html: <p class="test1">text-test1</p> CSS: .test1{ color:blue font-family:"Times New Roman"; font-size:20px; } |
|
The Format of Classes
Using classes is simple. You just need to add an extension to the typical CSS code and make sure you specify this extension in your HTML. Let's try this with an example of making two paragraphs that behave differently. First, we begin with the CSS code, note the red text. CSS Code: p.first{ color: blue; } p.second{ color: red; } HTML Code: <html> <body> <p>This is a normal paragraph.</p> <p class="first">This is a paragraph that uses the p.first CSS code!</p> <p class="second">This is a paragraph that uses the p.second CSS code!</p> ... Display: This is a normal paragraph. This is a paragraph that uses the p.first CSS code! This is a paragraph that uses the p.second CSS code! You can use CSS classes with any HTML element! However, what happens if we had already defined a value for the default <p> tag, would this cause any problems for classes of the paragraph tag? |
| Page 1 of 1 | [ 5 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group