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

body style declarations vs p

P: n/a
Hi
Is specifying attributes (basic font size, colour etc) with a "body"
tag in a style sheet as good as putting those things in a basic "p"
tag for the sheet?

If the answer is that using "p" rather than "body" is more reliable,
how do you specify the page background colour in css?

Is it true that to meet official standards all css sheets should be
presented in
lower case? Would that include things like "BODY" ("body"), TD,
A:ACTIVE etc?

Off the topic, but if you have two different (unrelated) bits of
javascript being used in a page, should the stuff that goes into the
head part of the doc be listed as two separate but consecutive
<script>blah</script> things, or can the two sections of script info
follow each other within one-only opening </script> and one-only
</script> (sorry, little knowledge of javascript - just pasting it
in).

Can anyone tell me a simple way of inserting some sort of code into a
Dreamweaver template (it goes at the bottom of the page in Copyright
info) that will cause the current year to be automatically inserted at
spot X when the pages are viewed that were produced from the template
or are linked to it?

Thanks
Dave
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
ze********@yahoo.com.au (Dave) wrote:
Is specifying attributes (basic font size, colour etc) with a "body"
tag in a style sheet as good as putting those things in a basic "p"
tag for the sheet?
Depends. There are various browser issues with inheritence which means
that sometimes specifying for the most deeply nested element is a good
idea. But generally specifying styles that apply to the whole page via
the body selector is fine.
Is it true that to meet official standards all css sheets should be
presented in lower case? Would that include things like "BODY" ("body"), TD,
A:ACTIVE etc?
No.
However, note that under some circumstances a style using BODY {} will
not match XHTML using <body>. This is not an issue with HTML but can
be with XHTML (if the browser is parsing it as XML/XHTML rather than
as HTML, etc.).
Off the topic, but if you have two different (unrelated) bits of
javascript being used in a page, should the stuff that goes into the
head part of the doc be listed as two separate but consecutive
<script>blah</script> things, or can the two sections of script info
follow each other within one-only opening </script> and one-only
</script> (sorry, little knowledge of javascript - just pasting it
in).


One script element. Or better still, one external .js file.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2

P: n/a
Thanks Steve,

if I were to use the selector
body { }
then, is it best to add to it such as
body tr td { }
?
Is it true that browsers can "forget" to apply those (body) attributes
to text that is in table cells of within <div> tags?

Dave

Steve Pugh <st***@pugh.net> wrote in message news:<nh********************************@4ax.com>. ..
ze********@yahoo.com.au (Dave) wrote:
Is specifying attributes (basic font size, colour etc) with a "body"
tag in a style sheet as good as putting those things in a basic "p"
tag for the sheet?


Depends. There are various browser issues with inheritence which means
that sometimes specifying for the most deeply nested element is a good
idea. But generally specifying styles that apply to the whole page via
the body selector is fine.
Is it true that to meet official standards all css sheets should be
presented in lower case? Would that include things like "BODY" ("body"), TD,
A:ACTIVE etc?


No.
However, note that under some circumstances a style using BODY {} will
not match XHTML using <body>. This is not an issue with HTML but can
be with XHTML (if the browser is parsing it as XML/XHTML rather than
as HTML, etc.).
Off the topic, but if you have two different (unrelated) bits of
javascript being used in a page, should the stuff that goes into the
head part of the doc be listed as two separate but consecutive
<script>blah</script> things, or can the two sections of script info
follow each other within one-only opening </script> and one-only
</script> (sorry, little knowledge of javascript - just pasting it
in).


One script element. Or better still, one external .js file.

Steve

Jul 20 '05 #3

P: n/a
ze********@yahoo.com.au (Dave) wrote:
if I were to use the selector
body { }
then, is it best to add to it such as
body tr td { }
The first selector matchs the body only, the second matches table cell
elements only. Depending on what you want to do they may or may not be
useful/
Is it true that browsers can "forget" to apply those (body) attributes
to text that is in table cells of within <div> tags?


Some browsers do not inherit some properties into tables; and some
browsers may or may not depending on what doctype you use.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.