PDA

View Full Version : trouble with link style


walkamongus
10-14-2009, 03:20 PM
hi, im wondering if someone can help me understand why my links styles arent working. is the fact that i have a link style inside of a different div class upsetting the code? thanks for any help


heres the html
<div class="class1"><span class="style1"><a href="bridalnav.html">enter</a></span></div>css
.class1 {
top: 350px;
width: 50px;
height: 11;
font-size: 12px;
color: #FFF;
text-align: center;
position: relative;
left: 300px;
z-index: 500;
font-family: Geneva, Verdana, Arial, Helvetica, sans-serif;
}

#style1 a:link {
color: #a44cc1;
font-size: 12px;
}

#style1 a:visited {
color: #a44cc1;
font-size: 12px;
}

#style1 a:hover {
color: #fff;
font-size: 12px;
}

#style1 a:active {
color: #fff;
font-size: 12px;
}

domedia
10-14-2009, 04:25 PM
What exactly is not working?
If you can post the page on the web somewhere this would be easier. You're only posting a little part of your page and the included files.

Yes, using the same classname for a parent and child makes no sense, but should not give any errors as far as I can see.

walkamongus
10-14-2009, 05:19 PM
sorry, the link works, the problem is that the link style attributes do not. heres a link to a test page... http://knewdesigns.org/test

the full css...
@charset "UTF-8";
/* CSS Document */

.arg {
top: 200px;
width: 50px;
height: 11;
font-size: 12px;
color: #FFF;
text-align: center;
position: relative;
left: 325px;
z-index: 500;
font-family: Geneva, Verdana, Arial, Helvetica, sans-serif;
}

#cool a:link {
color: #a44cc1;
font-size: 12px;
}

#cool a:visited {
color: #a44cc1;
font-size: 12px;
}

#cool a:hover {
color: #fff;
font-size: 12px;
}

#cool a:active {
color: #fff;
font-size: 12px;
}

Corrosive
10-14-2009, 06:12 PM
Could be that you are using a span but I can't be certain.

walkamongus
10-14-2009, 06:32 PM
thanks for the help... i just changed the #'s to periods and now it works. one website i was looking at had link styles like that, but a few more were using periods...

if a period denotes a span, what does a # mean? and how would the html differ?

Corrosive
10-14-2009, 06:44 PM
thanks for the help... i just changed the #'s to periods and now it works. one website i was looking at had link styles like that, but a few more were using periods...

if a period denotes a span, what does a # mean? and how would the html differ?

Not quite; a period is a CSS class. You can use these multiple times in a web page. A # is an ID and can be used only once. I said 'span' because that is what you have use to wrap the link.

walkamongus
10-14-2009, 07:31 PM
ok that makes sense. thanks for your help. :mrgreen:

domedia
10-15-2009, 04:42 PM
span {}
this selects the HTML element 'span'

#header {}
This selects the ID with value 'header'

.item {}
This selects all elements with he classname 'item'

walkamongus
10-17-2009, 09:11 PM
sweet, thannks for the help