Literal Values & Correcting Height Attribute for Validat
MRae825
Status: Interested
Joined: 04 Aug 2005
Posts: 16
Reply Quote
I currently have 38 errors on my page - which isn't too bad considering I had 57 minutes ago! However, the last 38 I am not sure how to fix. I am seeing that the majority of my errors are color/link/font values:

Line 43 column 12: an attribute value must be a literal unless it contains only name characters.
<BODY aLink=#330066 bgColor=#fffff0 link=#330066 text=#000000 vLink=#6699CC>

I have obviously used the coding with characters (I think they refer to this as hex values or something like that) - does the literal value mean to specify the color by its name? If so, I am not using just plain "yellow" in some of my colors - how do I fix this information but keep my current color scheme?

I vast majority of my errors have to do with this Body alink values stuff.

Lastly, how do I fix the height to read correctly?

I need a little expansion on this information I am not sure how to code it to make it css (with pix). Here is a couple example if someone could use them and correct them - explain it to me - I will try and fix the rest.

Line 45 column 61: there is no attribute "HEIGHT".
...E border=5 cellPadding=0 cellSpacing=2 width=754 height="648" bordercolor="#000000">


and another question regarding alignment. How do I fix these alignment problems?

Line 48 column 14: value of attribute "ALIGN" cannot be "MIDDLE"; must be one of "LEFT", "CENTER", "RIGHT", "JUSTIFY", "CHAR".
<TD align=middle bgColor=#aaaaaa colSpan=2 height=70 vAlign=center>


and another error

<TD align=left bgColor=#FFFFFF height=68 vAlign=center



I think that if someone can be so kind (Erik! LOL) to explain these errors to me and how to fix them - I will be able to kick the majority of my errors in the butt!

Thanks so much!
Back to top
erikZ
Status: Contributor
Joined: 30 May 2004
Posts: 148
Reply Quote
I would reread my posting in this thread on validation as well as doing the below. Note, there are a few slight errors I think on the W3C validation page itself.

:: Quote ::
Line 43 column 12: an attribute value must be a literal unless it contains only name characters.
<BODY aLink=#330066 bgColor=#fffff0 link=#330066 text=#000000 vLink=#6699CC>

The easiest way to get rid of this error is to totally get rid of the stuff. Add this to the beginning of your CSS file [before everything else, remember the cascade, this should be the first CSS in your css file:
:: Code ::
body, html {
padding:0;
margin:0;
}
body {
background-color:#fffff0;
color:#000000;
}
body a, body a:link {
color:#330066;
text-decoration:underline;
}
body a:visited {
color:#6699cc;
}
body a:hover {
text-decoration:none;
}
// then replace all that <body stuff with this:
<body>

:: Quote ::
I have obviously used the coding with characters (I think they refer to this as hex values or something like that) - does the literal value mean to specify the color by its name? If so, I am not using just plain "yellow" in some of my colors - how do I fix this information but keep my current color scheme?

Nope, you missed it, all it is saying is that all attribute values must be put into "...", like bgcolor="#4455aa". But just do the above, it's much cleaner, and much easier to maintain, and lets you control the entire site color scheme from a single CSS file.

:: Quote ::
Lastly, how do I fix the height to read correctly?

I need a little expansion on this information I am not sure how to code it to make it css (with pix). Here is a couple example if someone could use them and correct them - explain it to me - I will try and fix the rest.

Line 45 column 61: there is no attribute "HEIGHT".
...E border=5 cellPadding=0 cellSpacing=2 width=754 height="648" bordercolor="#000000">

These are pretty self explanatory, there is no attribute 'height' in valid HTML, so if you need that, simply apply an id or a class to that element, then declare it in CSS, however, in this case, you don't need the height at all, just get rid of it.

:: Quote ::
and another question regarding alignment. How do I fix these alignment problems?

Line 48 column 14: value of attribute "ALIGN" cannot be "MIDDLE"; must be one of "LEFT", "CENTER", "RIGHT", "JUSTIFY", "CHAR".
<TD align=middle bgColor=#aaaaaa colSpan=2 height=70 vAlign=center>

and another error

<TD align=left bgColor=#FFFFFF height=68 vAlign=center

That's also pretty self explanatory, align, as it says above, must be either left, center, or right. Plus some you won't use like justify and char. For practical purposes, the align attribute is only left right or center, it's how the contents of the element are horizontally aligned.

valign is vertical alignment, with only the values of top, bottom, or middle. These are very common mistakes.
Back to top
MRae825
Status: Interested
Joined: 04 Aug 2005
Posts: 16
Reply Quote
Erik,

I apologize that I overlooked a huge amount of information that you presented me with in that previous post. That pretty much sums it up for me! Thanks for taking the time to help me do this. You explained it all really well - I am not sure how I missed it all before? I thought I opened the topic and read the next messages - but I guess I overlooked them - I apologize for any redunancy! I have learned that in this HTML word - that is a no, no! :) I didn't mean to reask the same question but just for the record the 2nd post really cleared it all up for me too! This is some great information!!! I am going to work on validation and then try to get my css organized. THANK YOU!
Back to top
erikZ
Status: Contributor
Joined: 30 May 2004
Posts: 148
Reply Quote
:: Quote ::
I am not sure how I missed it all before?

I tend to edit my posts a lot, sorry about that, I always think of things I forgot or didn't expand on fully, then add them, so if you're reading it right after the first post was made, it will tend to grow.... LOL..
Back to top
MRae825
Status: Interested
Joined: 04 Aug 2005
Posts: 16
Reply Quote
:) hehe - well, that could be one reason! and I just don't have a ton of time to read in-depth during the day! I try to skim and get what I can! :)

So far so good - have 2 css files up and they are looking nice. I will let you know how it turns out - going to do one more css files as you suggested and see what happens with validation
Back to top
MRae825
Status: Interested
Joined: 04 Aug 2005
Posts: 16
Reply Quote
*sigh*

Well, I think I have most of my errors fixed and I am proud to say I figured it out! LOL

If you run my test page (indexnavbar.html), you will see 8 errors that seems to be some type of text generated by my hosting server (yes, I know - another reason Yahoo! is crappy) :)

Here is an example:
Error Line 256 column 179: required attribute "TYPE" not specified.
...//hostingprod.com/js_source/geov2.js"></script><script language="javascript">
The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.


Since I have actually had many "ah had" moments the past few hours, I can tell you right away what is wrong with that HTML - however, I can't fix it if it is not in my file?

Will this get generated on all my files I upload, and if so, can I just go into the files at my site and delete it off - I am assuming it will show there.

I guess I am happy that most of my errors are gone but stumped how to get rid of the stuff that I can't see?

Do I try to delete it or try to manage it?

Suggestions appreciated! So close to validation!!!

Edited to add: Erik will you check that I did the CSS correctly? Thanks!
Back to top
erikZ
Status: Contributor
Joined: 30 May 2004
Posts: 148
Reply Quote
You have essentially produced an error free page, that's very good. The inserted <script> tags at the bottom of your page are not under your control, and will not have any affect on your page display, don't worry about them. All the current errors come from those, and are not your fault, and are not under your control.

I'm impressed, that's a very good job, to get a page validating in basically one day from being exposed to the concept of validation.

CSS looks good, library files, that gets even more fun when you start playing around with the whole site from one collection of files.
Back to top
MRae825
Status: Interested
Joined: 04 Aug 2005
Posts: 16
Reply Quote
Great! Thanks so much - glad I finally got it figured out! Now will use this as my template for my pages and check to make sure they validate too....
Back to top
erikZ
Status: Contributor
Joined: 30 May 2004
Posts: 148
Reply Quote
For easy page validation, just use the web developer toolbar, that's an extension made for Firefox.

Using Firefox, click here, that takes you to the web developer toolbar download page, click on the 'install now' link, after a second Firefox will ask if you want to install it, say ok, wait for it to download and install, then restart firefox.

When it restarts, you'll see the web developer toolbar, I think, or you might have to click on it in view->toolbars->webdeveloper.

Then I think you have to add the 'tools' button, can't remember, that's the option that has the validation direct link on it. You can also just right click on any page to validate it using the same sequence.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours