OK, I'm starting to get the hang of this CSS stuff. I've got a website and have started using an external CSS sheet to format body, h1, h2, links, p, etc. The only one I haven't figured out yet is setting table characteristics. If I use the "table" tag, none of external CSS features show up. If I do the same CSS inline right after <table, it works fine. These are simple tables with one column and two or three rows. Do I need to be doing something with tr, td or something else. I'm stumped. Thanks for your help...Don in St. Paul
Here's a big chunk of my external CSS, including the table section. Below that is the inline style I use that works. Thanks for looking at it.
/* SETS BACKGROUND COLOR FOR THE WHOLE PAGE */ body {background-color:yellow; margin-left: 200px; margin-right: 200px width: 900px; }
/* SETS COLOR, FONT AND ALIGNMENT FOR THE MAIN TITLE */ h1 { font-family:"Trebuchet MS",Arial,"sans-serif"; font-size:36px; color:Navy; font-style:italic; font-weight:bold; text-align:center; }
/* SETS COLOR, FONT AND ALIGNMENT FOR SECTION HEADINGS */ h2 { font-family:"Trebuchet MS",Arial,"sans-serif"; font-size:17px; color:Navy; font-style:italic; font-weight:bold; text-align:center; }
/* FORMATS TEXT IN THE MAIN PARAGRAPHS */ p { font-family:"Trebuchet MS", Arial, "sans-serif"; color:#000000; font-size:13px; font-weight:bold; text-align:left; vertical-align:text-top; }
/* FORMATS TEXT IN THE PICTURE CAPTIONS */ h3 { font-family:Arial,"sans-serif"; color:#800000; font-weight:bold; font-style:italic; text-align:left; font-size:10px; }
Which external styles aren't working correctly? The only reason an inline style should work when an external one doesn't is if the external rule is being overwritten by another rule.
The section that isn't rendering correctly is the table section. Do I also need to declare for cells/rows or other table elements even if I don't want them highlighted?
Here's a big chunk of my external CSS, including the table section. Below that is the inline style I use that works. Thanks for looking at it.
Edit: Code tags added by Mod
If possible, you should avoid inline styles.