CSS - What Is a Class Selector
Interview Question Database For Software Developers
|
|
| What Is a Class Selector | | What Is a Class Selector? - CSS Tutorials - Introduction To CSS Basics | | By: FYIcenter.com | A class selector selects all HTML tags that matches the class name defined in the tag attribute of
class="class_name". Class selectors are specified with a leading dot like (.class_name).
For example, the following CSS definition uses a class selector:
/* set text to italic to all tags with class="quote" */
.quote {font-style: italic}
If you apply the above CSS definition to the following HTML document, you will get two blocks in italic,
one from the <p> tag and one from the <pre> tag:
<p>Normal paragraph...</p>
<p class="quote">Special paragraph...</p>
<pre>Normal pre-formatted text...</pre>
<pre class="quote">Special pre-formatted text...</pre>
| | ID: 1196 | Rank: 1090 | Votes: 0 | Views: 61 | Submitted: 20070511 |
1090 :-) | | What Is a ID Selector | | What Is a ID Selector? - CSS Tutorials - Introduction To CSS Basics... | | Submitted: 20070511 |
|
Copyright © 2009 FYIcenter.com
All rights in the contents of this Website are reserved by the individual author.
No part of the contents may be reproduced in any form without author's permission.
|
|
|