Jump to content

PHP: HTML to XHTML


eaglelegend

Recommended Posts

I beleieve that is the footer:

  </td>
</tr>
<tr>
<td colspan="2" bgcolor="#E73738" align="center">
<a href="http://validator.w3.org/check?uri=referer">
<img src="http://www.w3.org/Icons/valid-html401" border='0' alt="Valid HTML 4.01 Transitional" title="Valid HTML 4.01 Transitional" height="31" width="88" /></a> 
<a href="http://jigsaw.w3.org/css-validator/"><img class="c3" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!" title="Valid CSS!" /></a> 
<a href='http://www.noslang.com/validate.php?url=www.eaglelegend.com'><img src='http://images.eaglelegend.com/slangfree.gif' border='0' alt='Slang Free!' title='Slang Free!' /></a><br />
  <?php 
  echo $footer; 
  ?></td>
</tr>
</table>
</body>
</html>

 

what do should I do to correct that?

Link to comment
Share on other sites

In XHTML, elements cannot overlap. So opening tags that open after a different opening tag must be closed before the containing tag can be closed.

 

For example, this is no good:

<div><p></div></p>

 

Because the P tag is started after the DIV tag, it has to be closed before the DIV tag is closed. It should look like this:

 

<div><p></p></div>

 

This code is valid, because the P tag has been closed before the DIV tag, and as such is entirely enclosed within the div.

 

So if you have this:

 

<table><tr></table></tr>

 

Which is appears you do by the other poster's comments, then this will be invalid code.

Link to comment
Share on other sites

It depends on the type of data. Tables are fine to use. CSS is great, but not for tabular data. If you're displaying rows a something that has numbers or data for each row, then a table is good. But if you just have 3 columns with 1 cell where you're putting an image and saying what that image has to do with your site, using a div is better. There's no reason that using tables should be difficult. If you can write good markup, then you should be fine.

 

A lot of your errors, well actually all of them, stem from the missing DOCTYPE definition, missing quotes for tag attributes, wrong slashes, and use of attributes that don't exist (aren't supported) for some tags.

 

I agree that CSS should be used, but using tables and CSS is not a problem with a little practice.

 

Also, you are including a style sheet. There's no reason, IMO, to even have inline style definitions. If you're already using a style sheet, move your backgroud-color, margin, padding, etc. definitions to the style sheet. It's much easier to structure your page when you only have to look at the structural tags and not the styles. All of your style should be located in the same place. That way, if you have a problem with how something looks, you know exactly (or should) where to go. Instead of looking at the style sheet and seeing rules and looking at the tags and seeing attributes that are defined that may or may not conflict with the style sheet.

Link to comment
Share on other sites

It's only partly personal preference right now, and soon to be less so. Using semantic markup - i.e. making the content inside an element match the name of that element - helps improve SEO ratings to a small degree. However Yahoo is currently designing algorithms that will place a lot more priority on semantic markup, and if they do you know google and microsoft will be soon to follow. When this happens semantic markup will be significantly more important.

 

On top of this, pages laid out with CSS have faster loading times (from the second page onwards) due to caching of stylesheets, as well as easier to read code, which makes it easier to markup when the time comes. CSS also allows precise adjustments of page elements, with significantly less code.

 

Sure its personal preference, if you don't mind doing it the old, out of date way.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.