Using XHTML Instead of HTML Coding

Status
Not open for further replies.

ms2134

Yellow Belt
Many websites are still coded with the Good Ol' HTML website coding and little extras like JavaScript, but XHTML is one of the new forms of coding which is very simlilar to HTML.

XHTML tends to be a little cleaner and easy to work with than HTML, but everyone will have their own opinion on this . (Care to share?).

Learning XHTML is very easy if you already know how to code in HTML.

If you are not to familiar with using HTML, then starting out with XHTML is also very easy for you. It just takes a little time, some practice and a few edits here and there.

Everything about XHTML reminds me of HTML... OH yeah, that is because its almost identical to HTML 4.1. The main changes with this form of website developing code is that it is a stricter and much cleaner version of HTML, and is W3C Recommended.

~ Mike
 

SenseiDesign

Yellow Belt
well I'm still coding my pages in html :D the code is valid andn so everything is working but if I have some time left I might change some templates to xhtml easy to do as you said but if you are not used to it you should better do good html instead of crap xhtml
 

ms2134

Yellow Belt
Much Agreed. I tend to code in part HTMl and part XHTML right now, because i am getting to grips with the whole XHTML Thing. LOL :)

~ Mike
 
R

rabble

I'm still using HTML 4.01 transitional.
I probably won't be moving on until it no longer works for me.
I sure hope it works for a while too. I still have plenty of CSS
and javascript to learn before I go back to reearranging the bare bones.
 

Zoli

Yellow Belt
I never take care of html declaration. To be honest I have no idea which I use, I let rather Dreamweaver decide.
 
A

anurdh65

well,

iam always using HTML I tried for XHTML i feel its difficult to coding
 

LDHosting

Yellow Belt
If you're used to HTML, XHTML can look strange to you. I had the same thing until I realised XHTML seems to close everything, while HTML does not. That made it a lot easier for me.

There's also validators on the internet that show you the problems and all you have to do is copy/paste, so either way, switching from HTML to XHTML isn't much of a difference at all. It's probably easier to start with XHTML before you completely build your website in HTML to save you quite a bit of editing time. If you decide to switch anyway.
 
D

Dunchead

XHTML problem

I'm busy editing my site to XHTML. There are only minor differences from the HTML, but the only natural thing to do if you're starting out is just start learning XHTML, just as you'd opt to buy a brand new car rather than exactly the same one second hand if they were the same price. Which they are (free).

For me, in changing my code, I've run into a problem.

I was using CSS in the head section, with class selectors to make my table rows alternate colours:

td,pre,p{font-size: 13px; font-family: verdana;}
td{line-height: 20px;}
.tp{color:#0000FF; font-weight: bold;}
.rb{background:#FFFFFF}
.ry{background:#F0F0F0}

It looked fine until I changed the DOCTYPE to XHTML - then for some reason one table on my page seemed to become double spaced.

Anyone have any ideas why this might have happened?

You can see the source at mrquicker.com
 

LDHosting

Yellow Belt
I've had a quick look at your website and ran it through a HTML validator and it found 40 Errors and 25 warnings. Right now there's no DOCTYPE specified so it doesn't know what to use to check your site. I suggest you add a XHTML doctype and running it through a HTML validator yourself. (Sorry, I'm unable to post links.) It can help you switch to XHTML and possibly also fix some issues you're having.

I'm not sure what kind of spacing you're talking about, but if it is vertical spacing you might be able to use the CSS property line-height to fix the issue, though I'm not 100% sure if tables are affected by it. (I code with divs instead of tables)
 
Last edited:

boilerman

Yellow Belt
I was using CSS in the head section, with class selectors to make my table rows alternate colours:

td,pre,p{font-size: 13px; font-family: verdana;}
td{line-height: 20px;}
.tp{color:#0000FF; font-weight: bold;}
.rb{background:#FFFFFF}
.ry{background:#F0F0F0}

It looked fine until I changed the DOCTYPE to XHTML - then for some reason one table on my page seemed to become double spaced.

Anyone have any ideas why this might have happened?

You can see the source at mrquicker.com
1. Imho, tables are dinosaur solutions; you're better off using css to create the same effect without the downsides.
2. XHTML did away with the huge amounts of bugfixes to compensate for sloppy coding, and has a fairly high need for "clean" work. More likely than not your problem has something to do with code not being quite as it is supposed to be.
 
Status
Not open for further replies.
Top