Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

html and xhtml

Featured Replies

I got somewhere definition regarding the basic difference between html and xhtml that xhtml has the extention of html and some flexibility of xml.

 

Well i am not sure about it may be this could be wrong.So it would be great if some of you would define the basic difference between html and xhtml.

"Teh Rulez"

 

In XHTML, all tags must be closed (including things like <br> and <hr> and <img> which you might recognise from HTML), and all tags / attributes must be in lower case.

 

That's two obvious differences, anyways. :)

Also tags have to be closed in the correct order in XHTML so while in HTML you could do this:

 

<strong><em>text</strong></em>

 

 

In XHTML it has to be like this:

 

<em><strong>text</strong></em>

 

Notice how the last tag opened is the first tag closed, so your code has to be neatly ordered, if you close tags in the wrong order then you will get errors :)

Ah, yes, that reminds me. The elements have to be properly quote "nested" unquote. In a way, this is good, because it makes your markup a lot easier to see, especially when you have a crazy amount of elements.

 

There are also some deprecated elements that you shouldn't use anymore: b, i, u, font, center, are just 5 that spring to mind. :)

I found it pretty simple to change over from HTML 4.01 to XHTML 1.0 Transitional and CSS.

So as far as the coding goes, there were only a few minor changes.

 

Keep all coding lower case as already suggested, that is all your coding within the <tags>.

Remember - First tag in = Last tag out. So, for example.....<strong><b>HELLO WORLD</b></strong>

 

The single line break <br> in HTML then becomes <br /> in XHTML (remember the space after the r and before the "forward slash" in the <br /> tag if you want it to validate correctly at W3C.

Also for the Horizontal Rule <hr> in HTML. This should be change the same way as the <br> tag to <hr /> in XHTML.

 

Image tags. These did not need to be closed in HTML 4.01, but as a rule change to XHTML, they will now need to be closed, again with the space at the end as with the Line Break and Horizontal Rule tags.

EXAMPLE - <img src="images/background1.jpg" /> for XHTML.

 

The biggest change (which is fairly simple when you get used to the change) is the way that you layout your design.

Rather than using the <table> design format in HTML, this is now removed and replaced with the <div> design format using CSS, which is linked or embedded as an external file with certain coding within your <head>Tags</head>

Also, the <font> tags are removed and are then coded through your CSS file.

 

There is a little more to learn, but these are pretty much the basics.

I would definately recommend the change over from HTML 4.01 to XHTML/CSS.

There is a lot more control over the entire design and layout of your website with XHTML and CSS

 

Need any more info, just send me a personal message. Will be happy to help if I can.

I wouldn't say that I am an expert be any means, but I do have a little incite into XHTML and CSS.

 

Cheers for now

 

Jay

The biggest change (which is fairly simple when you get used to the change) is the way that you layout your design. Rather than using the <table> design format in HTML, this is now removed and replaced with the <div> design format using CSS, which is linked or embedded as an external file with certain coding within your <head>Tags</head>

[*cough*] Tables aren't *removed* in XHTML, they're still perfectly valid but their use is for tabulated data and not layout :)

[*cough*] Tables aren't *removed* in XHTML, they're still perfectly valid but their use is for tabulated data and not layout :)

 

Ooooop's LMAO Too true. I withdraw that quote HEE HEE. Thanks for the correction bluedreamer and apologies for my mis-quotation.

I am always coding for design and layout purposes only and have never used it in this case for "Tabulated Data" and didn't think for those that still use it for such purposes.

Again, I share my sincere apologies with you all.

 

Thanks again bluedreamer for correcting me :blush1:

 

Cheers for "EVER" LOL..........Jay :acute::sorry:

or in other words....In my case ONLY, they are removed. LOL. Silly me !!

 

Jay

There are also some deprecated elements that you shouldn't use anymore: b, i, u, font, center, are just 5 that spring to mind. :)

 

Na ah, <b> and <i> aren't deprecated tags, you can still validate XHTML 1.0 strict with them! I think their just 'frowned upon!' I think putting text in bold can also be useful for SEO purposes and it can be useful to refer to them in CSS instead of creating span's with an id or class for the smallest bits of text.

 

Also you can even still use <big> and <small> Why anybody would I don't really know!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.