Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Including link styles in CSS classes 1

Status
Not open for further replies.

DJR999

Programmer
Nov 19, 2003
16
0
0
US
I have a couple of similar questions.

1) I have a kind of table that will always have 3 columns, each with various styles defined. I know I can define a class for each column:
col.co11 {.....}
col.col2 {.....}
col.col3 {.....}
and then start my table
<table><col class=col1><col class=col2><col class=col3>...

But isn't there a way I can define all of styles for each column all inside one table class so that I can just start the table <table class=classname> and that is all I need? I haven't been able to do it.

2) Similarly, in this same table I want to have my links appear differently than the links in the rest of my page. I know I can define a separate class for the links:
a.t1:link {....} a.t1:visited {...} and then start each link <a class=t1.... or nest SPAN tags with this class inside the table tags. But isn't there a way I can define the style for these links and include them in my table class, so just by having a table of that class
<table class=whatever> the links will appear that way in the table?

Thanks,

Doug
 
But isn't there a way I can define all of styles for each column all inside one table class so that I can just start the table
Not if you want them to be distinct. You can give them one or more ids or a class.
Similarly, in this same table I want to have my links appear differently than the links in the rest of my page.
Code:
col#nav a 
{display: block;
   margin: 2px 0 3px 0; padding: 1px 5px 10px 5px;
   text-decoration: none;
   font: bold 100% Arial, Verdana, sans-serif;
   border-bottom: 1px solid rgb(60%,50%,40%);
   color: #000033; background: transparent;}

col#nav a:hover {background-color: #FFCC99;
   color: rgb(50%,0%,0%);
   border-bottom: 7px solid rgb(80%,30%,20%); 
   padding-bottom: 7px; margin-bottom: 0;}
Would give you specific formatting for any link in a column with the id of nav.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top