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

XHTML strict DTD questions

P: 6
Hello,
It is my understanding that you cannot use the element "align" in a strict DTD XHTML page. This is not working for me: float: center
which I thought was the correct way to do it. Any ideas??

Also, I have about 8 separate headings that all have the following attributes:
color:green; font-family:sans-serif; font-weight:bold
How would I code these all at once using a style sheet in the head? What would the coding be in the body section? Would I use the span element??

Thank you in advance.
Decorte
Sep 17 '06 #1
Share this Question
Share on Google+
7 Replies


P: 6
Sorry, when I said that I have 8 separate headings I meant to say that I have 8
separate items that are within the <dt> tags.
Thanks again,
Decorte
Sep 17 '06 #2

Banfa
Expert Mod 5K+
P: 8,916
center is not an valid value for float, if you want something in the center just center it either using text-align: center; on it's parent if it is an inline element or setting left and right margins to auto (and a width) if it is a block element.

To set the styling color:green; font-family:sans-serif; font-weight:bold on multiple elemnts just create a class

[html]
.someMeaningfulName {
color:green;
font-family:sans-serif;
font-weight:bold ;
}

...

<dt class="someMeaningfulName">Blah Blah Blah</dt>
[/html]

Another alternitive that takes less typing is to set a class or id on a parent element

[html]
#SomeMeaningfulName dt {
color:green;
font-family:sans-serif;
font-weight:bold ;
}

...

<dl id="SomeMeaninfulName">
<dt>This element gets the green etc styling</dt>
</dl>
[/html]

This is handy way to keep the html fairly clean from extra class attributes but still control your presentation.
Sep 17 '06 #3

P: 6
Thank you very much Banfa I'll give your suggestions a whirl.
I greatly appreciate your advice!
Decorte
P.S. - I find this "Strict stuff a bit confusing at times"
Sep 18 '06 #4

drhowarddrfine
Expert 5K+
P: 7,435
There is nothing confusing about 'this strict stuff'. Strict only means you have to follow the current rules and you can't use the old tags.
Sep 18 '06 #5

P: 6
To me "Strict" is a bit confusing considering that I just took a whole course on HTML (8 weeks worth). I also did one week of XHTML and one week of CSS.
So.........when the strict came in during the XHTML portion of my course it kind of through me off.
Decorte
P.S. - I knew nothing about web page designing before I took this course!
Sep 18 '06 #6

drhowarddrfine
Expert 5K+
P: 7,435
"Sometimes you have to run as fast as you can just to stay where you are." --The Queen of Hearts, Alice in Wonderland.
Sep 18 '06 #7

P: 6
You got that right!!
Thanks again,
Decorte
Sep 18 '06 #8

Post your reply

Sign in to post your reply or Sign up for a free account.