View Full Version : 2 Questions w/ CSS.. one being with Tables!


XxILostMyMindxX
10-26-2003, 02:20 PM
Hello! Frist.. I would like to make a news section. (Explained more here. (http://www.lissaexplains.com/forum/showthread.php?s=&threadid=43946)) What I want to know is can I make the colours, and sizes in CSS? I would like to be able to label them with "newstitle" for the title.. "newstext" for the text under the title in a different colour, and "newsopt" to say who posted and when. (newsopt being the same colour as title) I want to know if I can put <td><tr> somwhere in there.. and have it as class "newstitle" .. and not have to write it out everytime!

Second.. I would like to know if I can make my CSS code in notepad.. save it as *.css, upload it to my site server, and just type a code in.. so it will link to that.. to save space in my editor. If I can do this, what is the code??

Thanx for all your help!!

stargrl329
10-26-2003, 02:52 PM
you mean that you want to create several different TD classes, right? you could do something like this:
<style type="text/css">
td.newstitle{ color:red; }
td.newstext{ color:black; }
td.newsopt{ color:red; }
</style>
then for each TD cell that you want to have a certain property, put this:
<td class="newstitle">TITLE TEXT HERE</td>
and use that format for each additional TD, just fill in the correct name after "class".

as for using another .css file (called an external stylesheet), just upload the css file to your server then add this code in your head tag:
<link rel="stylesheet" href="stylesheet.css" type="text/css">just replace "stylesheet.css" with whatever filename you have for your stylesheet. good luck ;)

XxILostMyMindxX
10-26-2003, 02:54 PM
OH! thanx sooooooo much! That answered both my questions EXACTLY!!!!!!!! Thanx!!!!!!!!!!!!!!!!!!!!!!!

stargrl329
10-26-2003, 02:56 PM
you're very welcome! i'm glad i could help :D

XxILostMyMindxX
10-26-2003, 04:05 PM
Uh.. what if I wantewd to put a backround color on them in the CSS code.. how ywould I put that on there? And for the bored.. I only want a little black line.. is there any way I can do that too?

thanx a bunch!

stargrl329
10-26-2003, 04:10 PM
if you wanted to put a background color, (for example, gray) you could put this inside the brackets:
background-color:gray;

and do you mean, you just want a black line separating each TD? for that i would do something like - put a black border on the top and bottom TD cells, then for the cell in the middle, put a black border on the left and right, and white borders on the top and bottom. (i hope that made sense..lol) there's a topic on the forum, i believe, on how to get borders only on certain sides of cells.

XxILostMyMindxX
10-26-2003, 04:12 PM
Ohh!. ok.. thanx again for the help!!