advertisement
Deals | News | Forums

The Forum is sponsored by 
 

AAPL stock: $98.38 ( -0.64 )

*Cached every 60 seconds. For live updating, Click Here

You are currently viewing the Tips and Deals forum
CSS question
Posted by: bazookaman
Date: February 01, 2013 07:44AM
which is correct?

.footercontent a:link {
color:#FFFFFF;
text-decoration:none;
}

or

a.footercontent:link {
color:#FFFFFF;
text-decoration:none;
}




__________________________________
Never underestimate the predictability of stupidity
Options:  Reply • Quote
Re: CSS question
Posted by: ka jowct
Date: February 01, 2013 07:59AM
Are you trying to target links within an area with the class "footercontent"?



Edited 1 time(s). Last edit at 02/01/2013 08:05AM by ka jowct.
Options:  Reply • Quote
Re: CSS question
Posted by: bazookaman
Date: February 01, 2013 08:02AM
Not sure what they were doing. This is me coming into a company where all this was already done. All I know is that they had the css set up like the second example and the links where not showing up. I changed it to the first example and they magically reappeared. But I'm by no means a css expert.




__________________________________
Never underestimate the predictability of stupidity
Options:  Reply • Quote
Re: CSS question
Posted by: wolfcry911
Date: February 01, 2013 08:04AM
as ka jowct asks, is the class on the anchor or on it's parent (or ancestor)?

The link psuedo class is rarely used anymore...



Edited 1 time(s). Last edit at 02/01/2013 08:04AM by wolfcry911.
Options:  Reply • Quote
Re: CSS question
Posted by: ka jowct
Date: February 01, 2013 08:08AM
You've solved the problem, since one way works, and the other does not. I'm just getting back into this stuff, but I would have written it the first way.

[www.w3schools.com]

Two authors whose books I have relied on for years are Charles Wyke-Smith and Dan Cederholm.

[simplebits.com]
[www.stylinwithcss.com]

I also like this site:
[css.maxdesign.com.au]



Edited 1 time(s). Last edit at 02/01/2013 08:14AM by ka jowct.
Options:  Reply • Quote
Re: CSS question
Posted by: bazookaman
Date: February 01, 2013 08:11AM
Here it is in context...more or less...

<tr>
<td id="footercontentpane" runat="server" class="footercontent">
<div align="center" class="footercontent">
<a href="[www.xxx.aspx"]; class="footercontent">Returns</a>
</div>
</td>
</tr>




__________________________________
Never underestimate the predictability of stupidity
Options:  Reply • Quote
Re: CSS question
Posted by: ka jowct
Date: February 01, 2013 08:17AM
Is the whole site table-based?
Options:  Reply • Quote
Re: CSS question
Posted by: wolfcry911
Date: February 01, 2013 08:18AM
ugh confused smiley

table based layout, deprecated attributes, needless divs...

for what it's worth both examples should have worked - there must be something else going on.



Edited 1 time(s). Last edit at 02/01/2013 08:21AM by wolfcry911.
Options:  Reply • Quote
Re: CSS question
Posted by: bazookaman
Date: February 01, 2013 08:21AM
Quote
ka jowct
Is the whole site table-based?

Quote
wolfcry911
ugh confused smiley

table based layout, deprecated attributes, needless divs...

Yes. And yes.




__________________________________
Never underestimate the predictability of stupidity
Options:  Reply • Quote
Re: CSS question
Posted by: bazookaman
Date: February 01, 2013 08:22AM
Quote
wolfcry911
for what it's worth both examples should have worked - there must be something else going on.

That wouldn't surprise me. There is so much junk laying around on the server, I'm having a hard rime figuring out what is what. Plus it's Dot Net Nuke which I've never messed with so I'm trying to figure that out too.




__________________________________
Never underestimate the predictability of stupidity
Options:  Reply • Quote
Re: CSS question
Posted by: M A V I C
Date: February 01, 2013 11:01AM
Is there really a semicolon in the a tag?

Could be something like this:

<tr>
<td id="footercontentpane" runat="server" class="footercontent">
<div align="center">
<a href="#">Returns</a>
</div>
</td>
</tr>

.footercontent a:link {
color:#FFFFFF;
text-decoration:none;
}

Or like this:

<tr>
<td id="footercontentpane" runat="server">
<div align="center" >
<a href="#" class="footercontent">Returns</a>
</div>
</td>
</tr>

.footercontent {
color:#FFFFFF;
text-decoration:none;
}

And if you have a hover, active or visited state the css would be like:
.footercontent:hover {
color:#FFFFFF;
text-decoration:none;
}

You shouldn't add a before .footercontent - so just use .footercontent instead of a.footercontent - all adding the a does is make things slower.




Help MacInTouch: Buy from Amazon? use this link [amazon.com]
Mac News & Info: [macintouch.com] [macnn.com] [tuaw.com]
Mac Benchmarks: [barefeats.com]
Used Mac Stuff [FS/T]: [macswap.org] LowEndMac Swap List
Mac Software Updates: [macupdate.com]
Fonts: [dafont.com] [fontspace.com]
Online Computer Store With Mac Support: [macsales.com]
Options:  Reply • Quote
Re: CSS question
Posted by: wolfcry911
Date: February 01, 2013 11:32AM
Quote
M A V I C
You shouldn't add a before .footercontent - so just use .footercontent instead of a.footercontent - all adding the a does is make things slower.

Generally this is true. But in this case the anchor, its div parent and its ancestor td all have the same class so it may be necessary to differentiate. It may also be needed for specificity.
Options:  Reply • Quote
Re: CSS question
Posted by: M A V I C
Date: February 01, 2013 12:52PM
Quote
wolfcry911
Quote
M A V I C
You shouldn't add a before .footercontent - so just use .footercontent instead of a.footercontent - all adding the a does is make things slower.

Generally this is true. But in this case the anchor, its div parent and its ancestor td all have the same class so it may be necessary to differentiate. It may also be needed for specificity.

Well, the fact they all have the same class like that is another problem. Solving one problem by creating another isn't a good answer. Hence why in my examples I stripped those classes out.

But you talking about specificity... how much do you know CSS? I know a few web geeks on this board, didn't think you were one of them. You code much?




Help MacInTouch: Buy from Amazon? use this link [amazon.com]
Mac News & Info: [macintouch.com] [macnn.com] [tuaw.com]
Mac Benchmarks: [barefeats.com]
Used Mac Stuff [FS/T]: [macswap.org] LowEndMac Swap List
Mac Software Updates: [macupdate.com]
Fonts: [dafont.com] [fontspace.com]
Online Computer Store With Mac Support: [macsales.com]
Options:  Reply • Quote
Re: CSS question
Posted by: bazookaman
Date: February 01, 2013 12:55PM
Quote
M A V I C
Quote
wolfcry911
Quote
M A V I C
You shouldn't add a before .footercontent - so just use .footercontent instead of a.footercontent - all adding the a does is make things slower.

Generally this is true. But in this case the anchor, its div parent and its ancestor td all have the same class so it may be necessary to differentiate. It may also be needed for specificity.

Well, the fact they all have the same class like that is another problem. Solving one problem by creating another isn't a good answer. Hence why in my examples I stripped those classes out.

But you talking about specificity... how much do you know CSS? I know a few web geeks on this board, didn't think you were one of them. You code much?

He codes much.




__________________________________
Never underestimate the predictability of stupidity
Options:  Reply • Quote
Sorry, only registered users may post in this forum.

Click here to login