Forum Moderators: open

Message Too Old, No Replies

XHTML 1.0 strict

Started conversion(having problems)

         

Birdman

3:21 am on May 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello WW. Just started converting to XHTML 1.0 strict. I'm using w3c validator. I'm getting these errors all over my page.
Line 20, column 50:
... brides bouquets and corsages at our mart." border="0" width="730" src= ...
^
Error: there is no attribute "border" for this element (in this HTML version)
Line 20, column 50:
... t." border="0" width="730" src="images/logo.gif" />
^
Error: element "img" not allowed here; possible cause is an inline element containing a block-level element

Line 21, column 5:
<br />
^
Error: element "br" not allowed here; possible cause is an inline element containing a block-level element


Could anyone help here. I know I need to do more research, but if I could get these three errors straight, I would be 80% further along. It's pretty depressing seeing that scrollbar shrink to almost nothing on the validater results page. Thanx in advance.

caine

3:27 am on May 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



delete the border="0", no need for it.

SmallTime

3:44 am on May 26, 2002 (gmt 0)

10+ Year Member



I took a quick look at it, guess I would suggest the more research :) Might be easier to start from scratch in laying the page out for xhtml.

Marcia

3:49 am on May 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Line 21, column 5:
<br />
^
Error: element "br" not allowed here; possible cause is an inline element containing a block-level element

Doesn't that refer to the specifications for nesting of inline and block elements? Without seeing the code, I surmise it's because a block-level element is contained inside of tags for an inline element.

Birdman, let us know how it comes off after you check those two things out. If those are all over the page, it may be that you're pretty close to validating unless there's a lot of other errors in addition.

Birdman

4:01 am on May 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I may be out of my league with this, but since my next step was to validate, I figured I should shoot high. Plus papabaer and Nick_w talked me into it. ;) [webmasterworld.com ] <Birdman cackles>
Any really good tutorial pages you could show me. I do appreciate it.

papabaer

6:04 am on May 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello BirdMan! You will nail it and then feel pretty darned good about it too!

The power of the W3C Validator is that it gives conclusive "pointers" regarding what code snippets it flags. Sometimes it might seem a bit overwhelming, but it is not... really! Now first off, STRICT is just that: Strict! Some of the elements and attrbutes that are allowed in XHTML Transitional:

<?xml version="1.0"?>
<!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">

Are not allowed in Strict:

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

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

With Transitional, you are allowed to include <font></font> elements (resist these! use CSS!) and use attributes such as bgcolor="ffffff" while these are NOT allowed in XHTML Strict which expects presentational styling to come from CSS instructions rather than HTML tags.

A good reference for DEPRECATED TAGS & Attributes will come in handy here.

Also, as Marcia points out, improper nesting will earn you plenty of "yellow highlighter" courtesy of the W3C Validator! ;)

An example of an improperly nested element would be this:

<a href="another_page.htm"><h3>More Infomation</h3></a>

The above is incorrect while this:

<h3><a href="another_page.htm">More Information</a></h3>

is valid.

Remember, with XHTML STRICT, all "presentational" information is expected through style sheets.

You might sweat a bit before you get your code down but, you will have learned a lot about the "logic" of coding structure.

Keep the faith!
- papabaer

SmallTime

6:44 am on May 26, 2002 (gmt 0)

10+ Year Member



I didn't mean to be discouraging, it is an excellent learning experience. I had looked at it in Dreamweaver MX and the W3c, and you do have a lengthy list. But if you persevere, and try and learn while you go, it will be a lot easier the next time. Learning is fun.