aspose file tools*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 1436
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: 1436
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: 61066
    
  66

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: 1436
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: 61066
    
  66

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: H1 Tags in XHTML verses HTML