scorpion Posted November 12, 2009 Report Share Posted November 12, 2009 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? Quote Link to comment Share on other sites More sharing options...
Andrea Posted November 13, 2009 Report Share Posted November 13, 2009 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. Quote Link to comment Share on other sites More sharing options...
scorpion Posted November 13, 2009 Author Report Share Posted November 13, 2009 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. Quote Link to comment Share on other sites More sharing options...
jlhaslip Posted November 13, 2009 Report Share Posted November 13, 2009 Try using a bottom border on the element instead of an to see if the warnings go away. I think they will. Quote Link to comment Share on other sites More sharing options...
scorpion Posted November 13, 2009 Author Report Share Posted November 13, 2009 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 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 .... Quote Link to comment Share on other sites More sharing options...
Wickham Posted November 13, 2009 Report Share Posted November 13, 2009 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. Quote Link to comment Share on other sites More sharing options...
scorpion Posted November 13, 2009 Author Report Share Posted November 13, 2009 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. Quote Link to comment Share on other sites More sharing options...
Andrea Posted November 13, 2009 Report Share Posted November 13, 2009 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="". Quote Link to comment Share on other sites More sharing options...
scorpion Posted November 13, 2009 Author Report Share Posted November 13, 2009 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 Quote Link to comment Share on other sites More sharing options...
Andrea Posted November 13, 2009 Report Share Posted November 13, 2009 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. Quote Link to comment Share on other sites More sharing options...
scorpion Posted November 13, 2009 Author Report Share Posted November 13, 2009 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! Quote Link to comment Share on other sites More sharing options...
scorpion Posted November 14, 2009 Author Report Share Posted November 14, 2009 (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 November 14, 2009 by scorpion Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.