This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes H1 Tags in XHTML verses HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "H1 Tags in XHTML verses HTML" Watch "H1 Tags in XHTML verses HTML" New topic
Author

H1 Tags in XHTML verses HTML

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1394
I have changed the DOCTYPE in my app from HTML to XHTML. Now H1 tags that I modified using CSS do not appear to styled by the CSS definition. The documentation states that there are no differences in the H1 tags between HTML and XHTML.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
It should not make a difference unless the browser is now fixing invalid markup in a different way.

Can you give a snipplet of code?


Eric
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1394
Eric Pascarello wrote:It should not make a difference unless the browser is now fixing invalid markup in a different way.

Can you give a snipplet of code?


Eric


I found the issue was with the CSS property: font-size. Seems that DOCTYPE HTML 4.1 did not require the unit sufix but DOCTYPE XHTML 1.0 does. Example: 12px, 12 worked in HTML

Now I am having trouble with the hr tag. The CSS has color: red; property but the page displays the hr tag but no color.

page code:



CSS code:

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60821
    
  65

Steve Dyke wrote:I have changed the DOCTYPE in my app from HTML to XHTML

Kinda backwards. XHTML is dead. if you're going to change your page, make it HTML5.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1394
Bear Bibeault wrote:
Steve Dyke wrote:I have changed the DOCTYPE in my app from HTML to XHTML

Kinda backwards. XHTML is dead. if you're going to change your page, make it HTML5.


This all started when I desired to use a fancy confirm dialog box with yes and no options. I found a fastConfirm jquery solution but it will not work properly with DOCTYPE set to HTML 4.1.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60821
    
  65

Try it with HTML5. If it doesn't work, find a better plugin. I'd be very wary of a plugin that makes you change your doctype.

XHTML is a dinosaur.
 
wood burning stoves
 
subject: H1 Tags in XHTML verses HTML
 
Similar Threads
suggest good book on html 5
Html page doesn't include styles,given in document.
XHTML and DHTML
[struts2] [sitemesh] [i8N] its not decorate anymore
Struts 2, Tiles 2 and prototypejs