By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,395 Members | 1,882 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,395 IT Pros & Developers. It's quick & easy.

body tag inside a css file doesn't work.Why?

P: n/a
Hello to everyone,
i'm new to css and i have a question.
i have an external css (style.css) , that i link in all html pages.
inside the css file there is a class detais declared as follows:
*================================================= ========== */
..details {
font-family: tahoma, verdana, arial, helvetica;
font-size:11pt;
color:#051E78;

}
*================================================= ========== */
Moreover , inside the css file there is an html tag body declared as follows:
/*================================================= ========== */
body { font-family: tahoma, verdana, arial, helvetica;
font-size:11pt;
color:#051E78;
background-color:#87ceeb;
margin-top:0px;
margin-bottom:0px;
margin-right:0px;
margin-left:0px;
}
*================================================= ========== */
When i apply the details class inside a tag(i.e <td class=details>) everything is ok.
My font size is fixed to 11pt.
However when i don't apply the details class inside a tag (i.e <td>, <tr> or whatsoever) my fonts have variable length.Why does this happen?
I thought that the font size should be (11pt-fixed size) as they lie inside the <body> tag of my html page.
thanks in advance
thanasis
Jul 20 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
Thanasis (sch) wrote:
Hello to everyone,
i'm new to css and i have a question.
i have an external css (style.css) , that i link in all html pages.
inside the css file there is a *class* detais declared as follows:


Please don't post in HTML.

What browser are you using? At first sight, you're right - however, by
not supplying a URL we can't check your other code.

Also, note that fixed font sizes, especially in pt units for screen use,
is a bad idea. Search this group to find out why - do you really want
your fonts to be 0.15in high independent of screen size or resolution?

--
Mark.
Jul 20 '05 #2

P: n/a
Thanks for your reply Mark.

my css url is:

www.greek-properties.biz/style.css

yes i 'd like.Tell my how to do this
thanks in advance
thanasis
"Mark Tranchant" <ma**@tranchant.plus.com> wrote in message
news:bx*******************@stones.force9.net...
Thanasis (sch) wrote:
Hello to everyone,
i'm new to css and i have a question.
i have an external css (style.css) , that i link in all html pages.
inside the css file there is a *class* detais declared as follows:


Please don't post in HTML.

What browser are you using? At first sight, you're right - however, by
not supplying a URL we can't check your other code.

Also, note that fixed font sizes, especially in pt units for screen use,
is a bad idea. Search this group to find out why - do you really want
your fonts to be 0.15in high independent of screen size or resolution?

--
Mark.

Jul 20 '05 #3

P: n/a
my question is why the body tag doesn't work

"Thanasis (sch)" <th*********@hotmail.com> wrote in message
news:40********@news.sch.gr...
Thanks for your reply Mark.

my css url is:

www.greek-properties.biz/style.css

yes i 'd like.Tell my how to do this
thanks in advance
thanasis
"Mark Tranchant" <ma**@tranchant.plus.com> wrote in message
news:bx*******************@stones.force9.net...
Thanasis (sch) wrote:
Hello to everyone,
i'm new to css and i have a question.
i have an external css (style.css) , that i link in all html pages.
inside the css file there is a *class* detais declared as follows:


Please don't post in HTML.

What browser are you using? At first sight, you're right - however, by
not supplying a URL we can't check your other code.

Also, note that fixed font sizes, especially in pt units for screen use,
is a bad idea. Search this group to find out why - do you really want
your fonts to be 0.15in high independent of screen size or resolution?

--
Mark.


Jul 20 '05 #4

P: n/a
I 'm using IE 6
"Mark Tranchant" <ma**@tranchant.plus.com> wrote in message
news:bx*******************@stones.force9.net...
Thanasis (sch) wrote:
Hello to everyone,
i'm new to css and i have a question.
i have an external css (style.css) , that i link in all html pages.
inside the css file there is a *class* detais declared as follows:


Please don't post in HTML.

What browser are you using? At first sight, you're right - however, by
not supplying a URL we can't check your other code.

Also, note that fixed font sizes, especially in pt units for screen use,
is a bad idea. Search this group to find out why - do you really want
your fonts to be 0.15in high independent of screen size or resolution?

--
Mark.

Jul 20 '05 #5

P: n/a
Hello, Thanasis. Please, don't "top-post" (in addition to not
posting HTML). Read my comment below.

/Thanasis (sch)/:
details {
font-family: tahoma, verdana, arial, helvetica;
font-size:11pt;
color:#051E78;

}
body { font-family: tahoma, verdana, arial, helvetica;
font-size:11pt;
color:#051E78;
background-color:#87ceeb;
margin-top:0px;
margin-bottom:0px;
margin-right:0px;
margin-left:0px;
}

When *i apply the details class* inside a tag(i.e <td class=details>)
everything is ok.
My font size is *fixed* to 11pt.
However when *i don't apply the details class* inside a tag (i.e <td>,
<tr> or whatsoever) my fonts have *variable length*.Why does this happen?
I thought that the font size should be (11pt-fixed size) as they lie
inside the <body> tag of my html page.


It would help if you had told us what browser software you use and
if you had posted an URL for the page you're trying with.

I think you're encountering the quirky behavior of IE where only the
'font-family' is inherited by TABLE elements. When you use the
standards-compliance mode this behavior is corrected.

Read the comments under the "TABLE Elements Inherit Text Properties"
heading in "CSS Enhancements in Internet Explorer 6"
<http://msdn.microsoft.com/library/en-us/dnie60/html/cssenhancements.asp>.
Be sure to read about the DOCTYPE switch in that same document and
<http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/doctype.asp>.

--
Stanimir
Jul 20 '05 #6

P: n/a
Don't post to Usenet in HTML (or "rich text"). Use plain text.

Font size indicates its *height*, and isn't related to whether a font is fixed-width or variable-width. Tahoma, Verdana, Arial, and Helvetica are all variable-width fonts, so you specify any of them, variable width is what you're going to get. If you want a monospaced font, use font-family: monospace;.
Jul 20 '05 #7

P: n/a
Harlan Messinger wrote:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-7">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Don't post to Usenet in HTML (or "rich text"). Use =
plain=20
text.</FONT></DIV>

<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Font size indicates its *height*,

Come again? :-)

--

Barbara

http://home.wanadoo.nl/b.de.zoete/html/weblog.html
http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html

Jul 20 '05 #8

P: n/a
Barbara de Zoete <b_********@hotmail.com> wrote:
Harlan Messinger wrote:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-7">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Don't post to Usenet in HTML (or "rich text"). Use =
plain=20
text.</FONT></DIV>

<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Font size indicates its *height*,

Come again? :-)


Ouch! Blame Outlook Express, which I use for this at work. I *did*
select Plain Text format from the menu, but since the original was in
HTML, I guess it ignored me.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #9

P: n/a

Harlan Messinger wrote:
Barbara de Zoete <b_********@hotmail.com> wrote:

Harlan Messinger wrote:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-7">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Don't post to Usenet in HTML (or "rich text"). Use =
plain=20
text.</FONT></DIV>

<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Font size indicates its *height*,

Come again? :-)

Ouch! Blame Outlook Express, which I use for this at work. I *did*
select Plain Text format from the menu, but since the original was in
HTML, I guess it ignored me.


I belive there is somewhere in the setting for OE, something to
uncheck so you don't reply in the same :-)

--
/Arne

Jul 20 '05 #10

P: n/a
Arne <ar********@telia.com> wrote:

Harlan Messinger wrote:
Barbara de Zoete <b_********@hotmail.com> wrote:

Harlan Messinger wrote:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-7">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Don't post to Usenet in HTML (or "rich text"). Use =
plain=20
text.</FONT></DIV>

<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Font size indicates its *height*,

Come again? :-)

Ouch! Blame Outlook Express, which I use for this at work. I *did*
select Plain Text format from the menu, but since the original was in
HTML, I guess it ignored me.


I belive there is somewhere in the setting for OE, something to
uncheck so you don't reply in the same :-)


Reread the part where I said, "I *did* select Plain Text format from
the menu ...."

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #11

P: n/a
Dear Stanimir thanks for your reply,

i have noticed the same problem exists with NN and Mozilla. Not only IE
"Stanimir Stamenkov" <s7****@netscape.net> wrote in message
news:2g************@uni-berlin.de...
Hello, Thanasis. Please, don't "top-post" (in addition to not
posting HTML). Read my comment below.

/Thanasis (sch)/:
details {
font-family: tahoma, verdana, arial, helvetica;
font-size:11pt;
color:#051E78;

}
body { font-family: tahoma, verdana, arial, helvetica;
font-size:11pt;
color:#051E78;
background-color:#87ceeb;
margin-top:0px;
margin-bottom:0px;
margin-right:0px;
margin-left:0px;
}

When *i apply the details class* inside a tag(i.e <td class=details>)
everything is ok.
My font size is *fixed* to 11pt.
However when *i don't apply the details class* inside a tag (i.e <td>,
<tr> or whatsoever) my fonts have *variable length*.Why does this happen? I thought that the font size should be (11pt-fixed size) as they lie
inside the <body> tag of my html page.
It would help if you had told us what browser software you use and
if you had posted an URL for the page you're trying with.

I think you're encountering the quirky behavior of IE where only the
'font-family' is inherited by TABLE elements. When you use the
standards-compliance mode this behavior is corrected.

Read the comments under the "TABLE Elements Inherit Text Properties"
heading in "CSS Enhancements in Internet Explorer 6"
<http://msdn.microsoft.com/library/en-us/dnie60/html/cssenhancements.asp>.
Be sure to read about the DOCTYPE switch in that same document and

<http://msdn.microsoft.com/workshop/a...ects/doctype.a
sp>.
--
Stanimir

Jul 20 '05 #12

P: n/a
/Thanasis (sch)/:
i have noticed the same problem exists with NN and Mozilla. Not only IE


Yes, in quirks mode Mozilla/Netscape 7 is specifically designed to
mimic the broken behavior of Internet Explorer and the old Netscape
4. You may override this "patch" setting:

table { font-size: 100% }

in your stylesheet.

Once, again - please, don't top-post. Thank you.

--
Stanimir
Jul 20 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.