CSS font-size issues..

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

CSS font-size issues..

Post by Steveo31 »

Why isn't this working? I have a simple script for the body element of an HTML page:

Code: Select all

body {
    font-family:arial;	
	font-size:90%;
	padding:20px;
	padding-left:7%;
	padding-top:3%;
}
Everything works except for the font-size. I need it to apply to all text in the document, except when otherwise told to, like h4 or something. All the text is in tables, and if I put the font-size in the <td> CSS script, it works, but it also resizes <h4> and other varied-size-text.
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

In some browsers, upper-level font declarations do not cascade to include text in tables. I have no idea why, and yes, it's irritating. The simplest solution is to repeat your font-size declaration:

table {
font-size: 90%;
}

If you have further styles within the table, or in TDs, etc, they WILL then cascade normally from the TABLE declaration.
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

Extremely frustrating... td width

Post by Steveo31 »

I'm ready to punch my freakin computer out. Simplest task in the world and it can't do it. I KNOW this is right:

Code: Select all

td.type &#123;
	padding:5px;
	width:130px;
	background-color:#F0F8FF;
	font-size:12px;
&#125;
td.output &#123;
	padding:5px;
	width:130px;
	background-color:#F0F8FF;
	font-size:12px;
&#125;
and the td....

Code: Select all

<tr>
	   	   <td class="type">Posted By:</td>
		   <td class="output"><?php echo $row&#1111;'name']; ?></td>
	   </tr>
Doesn't work. The TD's end up being 50%.

Mozilla if that means anything.
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

use .type instead of td.type
Image Image
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

Post by Steveo31 »

Fixed. Just some style and non-style conflicts.
Post Reply