School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,117 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,007 people online right now. Registration is fast and FREE... Join Now!




Validating under XHTML

 

Validating under XHTML

heckyaaa

28 Oct, 2009 - 08:57 AM
Post #1

New D.I.C Head
*

Joined: 7 Oct, 2009
Posts: 35


My Contributions
I'm having a few slight issues with tags such as <h1>, <p>, <li>, <body bgcolor>, etc. Curious what I would do so that they don't pop up errors while validating.

CODE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

  <head>
     <title>AOHardware</title>
  </head>

  <body>
  <body bgcolor="PapayaWhip">
  <p>
  <h1>
    <Font size="3"><b>Logitech MX Performance Mouse</b>
   <br />
    <img src="logitech mouse.png" alt="What a neat looking input" width="130" height="120"/>
  <Ul>
    <li>In order to truly appreciate what logitech has to offer you in the means of computing devices, I feel that it may be completely necessary to provide yourself with some of the best they have to offer. The logitech MX Performance mouse is by far one of the most outstanding mice I've had in a long time. I've previously purchased the VX Performance and had really good luck with that however it is now outdated.</li>
   <hr />
      <b>Logitech Notebook Headset</b>
   <br />
    <img src="logitech headset.png" alt="Logitech Notebook Headset" width="120" height="130"/>
    <li>Being that this was my first headset it would be nice to find one that works really well, and it does. It has performed and is extremely clear.</li>
   <hr />
    <b>Antec CoolerMaster Three-hundred Case</b>
   <br />
    <img src="antec case.jpg" alt="Antec CoolerMaster Three-hundred Case" width="160" height="200"/>
    <li>Very happy with this case, it's quiet, cool and all you could ask for out of a mid-end case. For $49 with a 400 watt power supply how can you beat it.</li>
   <hr />
    <b>Western Digital External Hard Disk</b>
   <br />
    <img src="WD passport.jpg" alt="Western Digital External Hard Disk" width="190" height="180"/>
    <li>Something I've always planned on buying when I finally got my laptop, and yeah it's really convienent, small and sturdy. Great Buy!</li>
  </hl>
  </h1>
  </p>

  <p>
  <a href="AOHome.html">Home Page</a>
  <a href="AOCode.html">My Name in hex, binary and Decimal</a>
  <a href="http://www.c-w-p.net">CamoWolfProductions</a>
  </p>
    
    </font>
  </body>

</html>


User is offlineProfile CardPM
+Quote Post


baavgai

RE: Validating Under XHTML

28 Oct, 2009 - 09:18 AM
Post #2

Dreaming Coder
Group Icon

Joined: 16 Oct, 2007
Posts: 4,350



Thanked: 411 times
Dream Kudos: 550
Expert In: C, C++, Java, C#, ASP.NET, PHP, Perl, Python, Oracle, SQL Server, MySql, HTML, JavaScript, Lua, Cheese

My Contributions
This is a mess. It's not even well formed xml, let alone valid. Try: http://validator.w3.org/

You have two body tags, the font tag is quite dead... this really looks like homework.

Good luck.

User is offlineProfile CardPM
+Quote Post

Daegan

RE: Validating Under XHTML

28 Oct, 2009 - 07:48 PM
Post #3

D.I.C Head
Group Icon

Joined: 17 Mar, 2009
Posts: 64



Thanked: 3 times
Dream Kudos: 25
My Contributions
Giving you the benefit of a doubt, you should run the validator on the page, and then proceed to replace depreciated items with "current" accepted styles.

Use CSS.
User is offlineProfile CardPM
+Quote Post

arthurakay

RE: Validating Under XHTML

29 Oct, 2009 - 05:32 AM
Post #4

D.I.C Head
**

Joined: 17 Feb, 2009
Posts: 187



Thanked: 17 times
My Contributions
QUOTE(heckyaaa @ 28 Oct, 2009 - 09:57 AM) *

I'm having a few slight issues with tags such as <h1>, <p>, <li>, <body bgcolor>, etc. Curious what I would do so that they don't pop up errors while validating.


Yes, please validate that code. You'll get a gazillion errors, but you can get rid of most of them by simply learning how to nest your container tags.

For example (since you mentioned H1 and P tags), you have to close containers before you create new ones. Like this:
CODE

<h1>You Header</h1>

<p>Some text...</p>


NOT like this:
CODE

<p>
  <h1>
    <Font size="3"><b>Logitech MX Performance Mouse</b>
   <br />
    <img src="logitech mouse.png" alt="What a neat looking input" width="130" height="120"/>
  <Ul>


Other tags (like DIV) can have other elements nested inside them.
CODE

<div>
    <div>
        <h1>Header</h1>
        <p>Text...</p>
    </div>
</div>


The W3C Validator will tell you all of this, but that's a quick lesson in what you're doing (horribly) wrong.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 01:29PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month