Morticia
Well-known member
- Joined
- May 22, 2008
- Messages
- 17,771
- Reaction score
- 685
Do I have to have a style for each 'segment' (argh, I don't know the words I want)? ie- a separate style for each: body, p, table, td, etc? Or will a style for 'body' suffice for anything in the body? (Then having separate styles for things like <h1>, etc.)Well first you don't really want to list all all elements like ,td,th,table,p in the same definition as the body because styles cascade. Everything is contained in the body. So something in a <p> </p> inside the <body> will take on the properties of the body unless overidden by another style declaration.OK, I'm back at it again. In 2 separate places I have put in that the color of the font in the main body of the site should be black, it's white.
First off, here:
body,td,th,table {
font-family: Arial, Times New Roman, "sans serif";
font-size: 14px;
color: #000000;
width: 780px;
margin:auto;
}
Then again, here:
}
/* This section is for the text body.*/
table.info {
background-color: #fef2af;
color: #000000;
}
I have added this to the html:
<div>
<table class="info">
<tr>
<td height="25" colspan="2">
What am I missing?
Second question- I have commented out several items I don't want by putting /* */ at the beginning and the end of the statement. Do I have to put that on every line instead? I was messing around with changing 'px' to 'em' and found that a command I 'thought' was commented out was not. But as nothing is working the way I expected, I have to ask!
This is SO much more work than I thought it was going to be. Oh dear.
OK, I realized that all of my text is in a paragraph so I added 'p' to the first line and got all the text to be black. BUT, now everything is 'centered' instead of left justified. And the new table is 6 miles wider than the rest of the tables..
Times New Roman needs to be in quotes.
This will answer your question about css comments.
Hard to say on the font color. You are declaring it to be black so it ought to become black unless
I'd need to see the page in question and the full css to rule either of these in or out.
- you have an error higher up in your css that is preventing the declaration of black from getting read (this is very common)
- Something on page is specifying white as the color (ether on page or somewhere else in the css).
.
I did find that lists have to have their own style and I fixed that problem, except the 'bullet's' in the list are all white.
OK, I'm going thru the whole thing again and looking for punctuation errors.