HTML CSS examples for CSS Widget:Color
Different color for a link
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> a {<!-- w w w . j a v a2 s . co m--> text-decoration: underline; color: blue; } #abc a { color: green } #abc #def a { color: red; } #xyz a { color: purple; } #xyz a#two { color: orange; } #ghi a { color: brown; } #ghi a.secondary { color: grey; font-weight: bold; } </style> </head> <body> <div id="abc"> <a>This link is green.</a> <div id="def"> <a>This link is red.</a> </div> </div> <a>This link is blue.</a> <div id="xyz"> <a>This link is next to that link.</a> <a id="two">This link isn't the same color, though!</a> </div> <p> </p> <div id="ghi"> <a>This is a primary-style link.</a> <a>As is this.</a> <a>And this.</a> <a class="secondary">This is a secondary-style link.</a> <a>This is primary-style again.</a> <a class="secondary">And secondary-style.</a> </div> </body> </html>