CIMulation Posted March 17, 2010 Share Posted March 17, 2010 Page has set link effects. How do I incorporate separate effects for other links within the same page? For instance, the links are currently in red and underlined. When you rollover them, they turn blue. What I want to do is add more links, but have those links be displayed in white and turn yellow when rolled over. Not sure if it makes anything worse, but this is on my PHP store page as well. Sorry if this is a noob question. I'm really new to this. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- a:link { color: #F00; } a:visited { color: #F00; } a:hover { color: #FFF; } a:active { color: #F00; } --> </style></head> <style type="text/css"> <!-- a.external:link {color: #00F; font-size: 18pt; font-weight: bold; } a.external:visited {color: #00F; font-weight: bold; } a.external:hover {text-decoration: overline; background-color: #003399; } a.external:active {color: #00F; } --> </style></head> <body> <a href="www.msn.com">Home</a> <div class="external"> <a href="www.msn.com/sports">External</a> </div> </body> </html> Quote Link to comment Share on other sites More sharing options...
Omirion Posted March 18, 2010 Share Posted March 18, 2010 This should be posted in the CSS section just fYI. In CSS when you wanty to define separate element proprieties you do it like so. a { Posititon: relative; left: 100 px; } Lets say you have a DIV wityh an ID tag of 'myDiv' You declare styuff for it like so. #myDiv{ position: relative; left: 100 px; background: black; } So let's say you won't to style all the a elemets that are child elemets in the 'myDiv' div. That is to say, all <a> elements that are 'IN' in div. You style the CSS like so. #myDiv a { position: relative; } Say you have a bunch of divs with the class value of childDivs in your myDiv. You style them like so. #myDiv .childDivs { display: inline ; Whatever : whatever; } I hope this gives you a basic understanding of the way child CSS selectors work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.