Matt Kohanek wrote:Im using Eclipse btw.
That should have no bearing on your issues, but thanks for mentioning it.
I guess the first step
you should take is to see if the browser is able to find your CSS file without a problem. Point your browser to
http://localhost/NIRAP/WebContent/test/commons.css (substitute localhost if required) and see if the CSS is displayed in the browser window. If not, then the problem is with your location of the CSS file.
If the CSS is displaying properly, then you might want to check a minimalistic page to see if it works. I tried your style sheet with the following HTML, and confirmed that it worked perfectly.
If only one section of that works (e.g. the DIV shows the larger font-size but the table does not) then it is likely that you have some other style affecting your table data. I would recommend you use
Firefox with the
Web Developer toolbar. Using that you can see far more information about what style is being applied to each element. At a very high level, I can see that my example code above has:
Since I had such a simplistic example, there is only the one class being shown, and none of the previous elements have anything of interest to show. However I then made a more "interesting" example, where I knew I would be overriding different styles. My HTML now looks like:
And the CSS looks like:
Using the Web Developer, I can see where the various styles came from, and the order they were applied:
And when I look at it in the browser, I do indeed see that the "small" font size is the last one used.
Note that my CSS had the font size for the generic td element defined
after the specific class of .skin_line, however the Web Developer tool correctly identified that the td element's generic style would be applied first, then the .skin_line, then the #small.
By the way - I assume at some point you will be moving away from using pixels for font sizes and move to em-quads? One discussion of it's use is at
EM vs. Pixel
Likewise, unless you are actually displaying tabular data, the use of tables is not a good idea. But one thing at a time.