Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Use Class Selectors to Differentiate Tag Instances
How To Use Class Selectors to Differentiate Tag Instances? - CSS Tutorials - Introduction To CSS Basics
✍: FYIcenter.com
A more reliable way to identify tag instances is to use the class attributes and class selectors. In the CSS example below, class="url" is added to <P> tags for Web addresses, with a new CSS definitions using a class selector "P.url". All three selectors match the Web address text, but the class selector "P.url" wins because of the cascading order rules. So you will see Web addresses in bold "sans-serif":
<html><head> <title>CSS Included</title> <style type="text/css"> /* matches P instances with class="url" only */ P.url {margin-top: 0px; margin-left: 20px; font-family: sans-serif; fond-weight: bold} /* matches P instances inside TABLE only */ TABLE P {margin-top: 0px; margin-left: 40px; font-family: serif; font-size: 12pt; color: blue} /* matches all instances of tag P */ P {font-family: arial; font-size: 14pt; color: black} </style> </head><body> <p>Welcome to FYICenter.com resource listings:<br> <table> <tr><td><p class="url">www.w3.org</p></td> <td><p>W3 home page.<p></td></tr> <tr><td><p class="url">www.php.net</p></td> <td><p>PHP home page.<p></td></tr> <tr><td><p class="url">www.google.com</p></td> <td><p>Google search.<p></td></tr> </table> </body></html>
Note that Web address is displayed in blue. Why? Because color is not defined with "P.url", so "TABLE P" wins the color definition.
2007-05-11, 4681👍, 0💬
Popular Posts:
How to reduce the final size of an executable file? Size of the final execuatable can be reduced usi...
How To Compile a JUnit Test Class? Compiling a JUnit test class is like compiling any other Java cla...
What metrics will you look at in order to see the project is moving successfully? Most metric sets d...
What is the difference between "printf(...)" and "sprintf(...)"? sprintf(...) writes data to the cha...
How To Download and install PSP Evaluation? - PSP Tutorials - Fading Images to Background Colors wit...