hi,
i am new here
how i can connect all links inside a table to a css style,
thanks,
nokia3410
link inside a table
Hi nokia3410,
Welcome to the CSS forum.
To target all the links within a table try
table a{color:green;}or if you have more then one table you could give the table you are targeting a class like
<table class="mylinks">
then target it like
.mylinks a{color:red;}
Hope that helps
re:reply
Hi tony,
thank you fo your reply,
Actually my qstn is diff,
Please check this link : http://www.cellsina.com/links_page_4.htm
there you can find links inside a table,
i need to add css to this links,
now i am doing one by one, is there any other way to apply all.
i am new with html 7 internet
thanks
link inside a table
Are you referring to the table on the left?
re:reply
hi,
thanks for your reply,
on right with links
Please note this is my qstn : i made one table with 10 links, i want to add css to this links, not to the whole page only inside the table, now i am adding one by one
thanks
link inside a table
Then do exactly what Tony has said. I'll answer with some examples.
Say you have one page, with one table. THere are links on the page, and links in the table.
If in the css, you type
a {color: green;}
This will give EVERY link on the page a green color.
If you want to target only the table, you would use the following piece of CSS:
table a{color:green;}
However, if you have more than one table with regular text links in, then this will affect every table with links.
If you only want to target one table (eg a menu on the left of a site), then use the following in the CSS:
.mylinks a{color:red;}
and in the html, where you specify the left menu table, use this code
<table class="mylinks">
This will give EVERY link in ONLY THAT table a color of red, every other link will be whatever color you specified in the css (in the above example, green).
link inside a table
The above recommendations are right on! But as a newbie to another newbie, just a couple things to keep in mind. If you want your hover color to be applied as well, be sure to define your link visited states before your hover state, or you will run in to some problems in the display. I like the recommendation about classes, because it won't limit your usage of the same method elsewhere on the same page.
Maybe this makes more sense:
Here is your table code calling the class called "links":
<table class="links" border="1"> <tr><td><a href="#">Link 1</a></td></tr> <tr><td><a href="#">Link 2</a></td></tr> <tr><td><a href="#">Link 3</a></td></tr> </table>
And here is your CSS defining that class:
table.links a { color: #003399; text-decoration: none; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; } table.links a:link, table.links a:visited { color: #003366; } table.links a:hover { color: #CC9900; }
I find this to be quite effective since all you have to do is change the class name and CSS to make all your tables do different things with their links if you choose!