Forum Moderators: not2easy

Message Too Old, No Replies

Why does font get bigger?

Know how to solve it, but why?

         

reddevil

5:08 pm on Feb 8, 2006 (gmt 0)

10+ Year Member



I have been trying to put all my styling in css and at the same time minimise the amount of css.

I have styled the body, table, td and then added other classes for td's that will be shown with minor changes.


HTML

<body>

<table class="table" cellspacing="0" cellpadding="0">

<tr>
<td class="leftmenu">
<table class="table2" cellspacing="0" cellpadding="0">

<tr>
<td class="contentbox2">box 2 content goes here</td>
</tr>
</tr>

</table>
</table>
</body>

CSS

body {
font-family:Verdana,Arial,Helvetica, sans-serif;
color:#000000;
background-color:#DAE7FE;
margin:0;
padding:0;
}

table {
width: 100%;
vertical-align: top;
}

.table2 {
width: 95%;
background-color:#FFFFFF;
vertical-align: top;
}

td {
font-family: Verdana,Arial,Helvetica, sans-serif;
width:100%
font-size:11px;
font-weight:normal;
color:#000080;
vertical-align:top;
text-align:left;
}

.contentbox2 {
background-color: #DAE7FE;
border:2px solid #72A8DD;
padding:5px;
}

.leftmenu {
text-align: left;
vertical-align: top;
padding:5px;
line-height: 110%;
width:20%;
}

The font in .contentbox2 is larger than the 11px that I require but I don't understand why?

The main td is where the font size of 11px is specified so I thought that would take precedence. It seems such a waste to copy and paste all the coding from td into the .contentbox2 and other classes?

Fotiman

5:21 pm on Feb 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You are missing a semi-colon after your width style for td, thus the font-size (and everything after width) is ignored.

reddevil

5:33 pm on Feb 8, 2006 (gmt 0)

10+ Year Member



fotiman,

thanks a lot for your reply - yup, that absolutely solved everything. Isn't it amazing that a semi-colon can make such a difference, and also affect everything else int he td

Now at last, I can sleep easy at night.

Cheers.