Jump to content

Recommended Posts

Posted

I am using HTML 4.01 Strict Doc declaration and trying to do the right thing and validate my site using

http://validator.w3.org/

I am getting multiple errors with:-


[This line displays perfectly in FF and IE7]

 

Errors reported with this line are:-

Attribute "WIDTH" is not a valid attribute. Did you mean "width"? [the '2' is red and underlined]

Attribute "SIZE" is not a valid attribute. Did you mean "size"? [the '5' is red and underlined]

Attribute "COLOR" is not a valid attribute. Did you mean "color"? [ the first quotation mark is red and underlined]

 

Am I doing anything wrong or should I ignore these 'errors'?

 

There are similar 'errors' posted throughout the code, eg:-

Text Here

element "FONT" undefined. Did you mean "font"? [the '>' after size="2" is red and underlined]

 

I am clearly using lowercase not uppercase as suggested. Anything else I need to do?

Posted

Do you have a link to the page? Looks like you're at least missing the quotes around the 200 and the 5.

 

And, according to http://www.w3schools.com/tags/tag_hr.asp All "presentation attributes" of the hr element were deprecated in HTML 4.01, and are not supported in XHTML 1.0 Strict DTD. (and in HTML 4.01 obviously not, either) -- you can style it with CSS.

 

The font tag has also long been deprecated. -- again, use CSS for your formatting.

Posted

I have found the deprecation details on HTML 4.01 strict and am working through it.

 

I have tried adding to the CSS:-

hr.divide {

width:200px;

color:#506F89;

size:5px;

}

 

And HTML


 

Width works but color and size do not.

 

Changing HTML to:-


 

Gives width and thickness but no color.

Posted
Try using a bottom border on the element instead of an
to see if the warnings go away. I think they will.

 

I am only wanting the line to be 200px long, not full width of the element.

Solved the problem by using using the line as an image, bar.jpg

 

Bar

With css

 

.center {

text-align: center:

}

This appears to center the 200px long, 5px wide blue dividing line as required.

 

I will back with more... I still have lots of errors reported !!!

Learning lots though ....

Posted

 

I have tried adding to the CSS:-

hr.divide {

width:200px;

color:#506F89;

size:5px;

}

 

And HTML


 

Width works but color and size do not.

 

Changing HTML to:-


 

Gives width and thickness but no color.

 

Some browsers process color, some background-color, so you have to use both styles.

 

See http://www.wickham43.net/horizontalrule.html for general information.

Posted

Wickham .. you are a legend !!!

 

Your tutorial makes horizontal rules perfectly clear.

Have bookmarked your home page too for same light reading .. ready to learn a lot more.

 

Thanks again.

Posted

bar.jpg

The purpose of an alt tag is to describe to one who may not be able to see the image (a search engine or a vision impaired surfer) what they are missing. So if you post a photo of your dog chasing a ball, write alt="My dog Spot chasing a red ball in the back yard". The image above is purely decorative and serves absolutely no purpose content-wise. So there you would write alt="".
Posted

Good point, Thelma. I guess I was in a hurry here. In the case above, I have removed that image entirely and replaced, thanks to Wickham's tutorial, as follows

 

In the CSS:-

hr.bar {

width:200px;

height:4px;

color:#506F89;

background-color:#506F89;

text-align:center;

border:none;

}

 

In the HTML:-


 

I will, however, go through all my other images and set up the 'alt' tag more appropriately, thank you for bringing it to my attention.

 

My next problem is, How does one change a word or two in the middle of a line of text into a different color? Using a class in

..

breaks the line of course. I can .. or .. OK but .. is not allowed in 4.01
Posted

If it is just one time in the entire site you want to do that, just use inline styling

 

Bla bla bla bla bla bla.

 

If you'll use that coloring more often:

 

something gray

 

And in your css, style the .gray.

Posted

Once again I thank you Thelma, is what I was needing.

 

I tend to learn by absorbing each tag as I need it. Trying to learn all the tags and their attributes is so DRY until you have a use for that particular one! I have been using the search feature of W3C Schools Tutorials to find answers which is useful, but sometimes trying to find something like 'changing color within a line of text' doesn't get me a solution at W3C.

 

I have 13 pages now that validate to 4.01 strict so I am progressing!

Posted (edited)

I am chuffed!!! All 35 pages on my website have now validated to HTML 4.01 Strict !

 

It may not be the prettiest but I am happy with my efforts, all hand coded. Thank you all for your help in getting me up to speed.

 

Notepage++ is such a great program ... cheers all!

 

Dennis Wright

www.irishtype3dna.org/

Edited by scorpion

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...