Forum Moderators: not2easy
Is there a way?
Here is what I currently have.
<a href="http://www.widgets.com/"><span CLASS="footer">Widgets</span></a>
<a href="http://www.widgets.com/"><span CLASS="footer">Widgets</span></a>
<a href="http://www.widgets.com/"><span CLASS="footer">Widgets</span></a>
<p class="footer">
<a href="link1.html">link 1</a>
<a href="link2.html">link 2</a>
<a href="link3.html">link 3</a>
</p>
Or better yet, since the links are actually a list, style it so it doesn't display like a list:
<style type="text/css">
.footer { margin:0; padding:0; text-align:center; }
.footer li { list-style-type:none; display: inline; }
</style>
<ul class="footer">
<li><a href="link1.html">link 1</a></li>
<li><a href="link2.html">link 2</a></li>
<li><a href="link3.html">link 3</a></li>
</ul>
If you want to color the link itself or affect hovers, use:
a.footer:link { color: #ff0000; }
a.footer:visited { color: #ffff00; }
a.footer:active { color: #ffffff; }
a.footer:hover { color: #0000ff; }
I'd try to make sure the html makes sense from a content viewpoint. As soon as you have that, there is most likely no need to add any span tags at all. Personally I'd avoid span tags unless I've no other way to denote the specialness of a part on another tag, i.e. I consider it like a "b" or "i" tag.
I think I left out some important information.
I have three horizontal columns of internal links 18 deep on my homepage (All States) I currently have them in a table using <tr><td> to position the links e.g.
<table width="70%" align="center">
<tr><td>
<a href="/widgets"><span CLASS="footer">Alabama Widget Directory</span></a><br></td><td><a href="/widgets"><span CLASS="footer">Alaska Widget Directory</span></a><br></td><td><a href="/widgets"><span CLASS="footer">Arizona Widget Directory</span></a><br></td></tr><tr><td><a href="/widgets"><span CLASS="footer">Arkansas Widget Directory</span></a><br></td><td><a href="/widgets"><span CLASS="footer">California Widget Directory</span></a><br></td><td><a href="/widgets"><span CLASS="footer">Colorado Widget Directory</span></a><br></td></tr>
</table>
I would like to some how get rid of the <span>. What I tried above did not work in the table. I also would like to place a simple black border or box around the group of internal links.
New to this type of css with tables and appreciate any help you can give.
Thanks in advance!
CSS:
.footer a {color:green;} /* or your styles here */ HTML:
<table width="70%" align="center" [b]class="footer"[/b]>
<tr>
<td><a href="/widgets">Alabama Widget Directory</a></td>
<td><a href="/widgets">Alaska Widget Directory</a></td>
<td><a href="/widgets">Arizona Widget Directory</a></td>
</tr><tr>
<td><a href="/widgets">Arkansas Widget Directory</a></td>
<td><a href="/widgets">California Widget Directory</a></td>
<td><a href="/widgets">Colorado Widget Directory</a></td>
</tr>
</table> No need for the spans or the line-breaks - you can apply bottom padding to the table cells with
.footer td {padding-bottom:12px;} or similar.
Thanks for your reply. I know why it would not work. I have a css rule for .a That took care of all my links. Any idea how to override it without going through the site and editing all the existing links?
I only want to change the font for this one area of the site.
Also how hard is to outline or box this table of links?
Thanks again.
So, for example, if you have a global rule setting the link color:
a {color:red;} Then all links on the page will be red. If you have one specific table where you want the links to be green rather than red, then if you define a
class on that container (the table), then you can set a more specific rule: .footer a {color:green;} The second rule is more specific than your global rule above.
A {
font-family: Tahoma,Helvetica,Arial,Sans-serif;
font-size: 10pt;
color: #000000;
margin:0;
padding:0.2em;
text-decoration: underline;
}
This is what I created:
State A {
font-family: Helvetica,Arial,Sans-serif;
font-size: 8pt;
color: #333333;
text-decoration: underline;
}
Then for the table I put in <span class="State A>
All the links </span>
It is not working. What did I do wrong?
Thanks
.State a { ... }
You are missing the leading .
Also, your class value should just be "State", not "State A".
<span class="State">
Finally, you should not use pt for font sizes on the web. Use ems or percentages. Points are for print media.
[edited by: Fotiman at 6:17 pm (utc) on Dec. 5, 2006]
.footer {border: 1px solid black;}
(Or add the content to your existing .footer statement)
Do test it well as browser support for styled tables is somewhat iffy (IE is the culprit, as usual; even IE7 still has bugs)