Forum Moderators: not2easy

Message Too Old, No Replies

Font Inheritance from <body>?

until I also described it in DIV

         

Shadows Papa

1:25 pm on Oct 29, 2003 (gmt 0)

10+ Year Member



This affected all pages. I use an EXTERNAL style sheet (is that the correct term?)
I want all of my text that is not otherwise defined to be Verdana 10 (and you can feel free to point out the error of my ways)
I have this in my CSS (I've trimmed the image stuff, only relevant FONT things included)

body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
}

.content {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}

td {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
}

I have the main body, and ALL content in a DIV with the class "content". This defines yet another background image and margins. I have a header div, then a table for two columns, then I have text that is not in a table or DIV other than the content DIV, which all things are in. This single line of text would not take on the proper font until I added this to my stylesheet:

div {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
}

Is this normal? I thought that since ALL things are in the DIV class "content" that it would take on the proper font - uh, well, maybe I see an issue? I see I have 10pt in one place and 10px in another.........
Well, comment anyone, in the meantime, I'll play with that...... I'd like to know if after defining a font in the DIV class="content" I should have to define it elsewhere. Maybe I see the issue now.

Shadows Papa

Pricey

2:02 pm on Oct 29, 2003 (gmt 0)

10+ Year Member



Hi, Shadows_Papa

It looks like the pt vs pc could be a priblem.
I think pt will not work and it will just make the font default itself, so px is the way to do it.

1px = 0.75pt btw, just for ref ;)

BlobFisk

2:17 pm on Oct 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about:


* {
font: 10px Verdana, Arial, Helvetica, sans-serif;
}

Watch IE though, it has some trouble cascading the font down into <td>'s.... To allow for this, try:


* , td {
font: 10px Verdana, Arial, Helvetica, sans-serif;
}

Shadows Papa

2:24 pm on Oct 29, 2003 (gmt 0)

10+ Year Member



Does the '*' mean apply to everything - all classes?
so if I wanted the same font in everything it wasn't defined in otherwise, I could use the * instead of 3 or 4 different sections like div, td, body, etc. I could simply make it *?

It was the PT vs. PX thing - the px was a bit smaller, when I changed it, I found that it was working, I just had it defined incorrectly.
And to get 10PT, I'd need to state 13 or 14px to get the same, correct?
I'll try it - takes only seconds.
Thanks again to all.

Shadows Papa

BlobFisk

2:32 pm on Oct 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




Does the '*' mean apply to everything - all classes?

Yep, everything. By putting it at the top of your CSS, when you redifine the font for a class below it in the CSS file, the new font will apply to that style.

fshagan

4:13 pm on Oct 29, 2003 (gmt 0)

10+ Year Member



I'm just beginning at this as well, so this is more of a suggestion/guess, but one of the on-line sources I've read said that in some browsers you'll need to add "html" to your page-wide style declarations (if that's the right terminology!) Example:


body, html {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
}

I can't remember which resource I found that in, though. It might be worth a try.