www.webdeveloper.com
Results 1 to 5 of 5

Thread: Problems with validation

  1. #1
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132

    Question Problems with validation

    Back in December, there was a post '.. Make the gaps stop' by 'cdxrevvved' where some suggestions about validation were given. I validate my pages using Homesite and thought I would try http://validator.w3.org as suggested in that post.

    I got the a few minor errors regarding 'alt' in my image tags which were easily fixed but I got two additional errors that I am unable to resolve.

    1.
    <body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0"> which was suggested by Zach Elfers that I've been using for a long time.

    Stefan responded with.....

    Now we can rip out that proprietary crapcode you just added (marginheight="0" marginwidth="0" leftmargin="0" topmargin="0")

    and suggested the use of..

    body {margin:0;}

    But this does not work in NS4xx. Is there a 'valid' fix other than don't use NS4xx, upgrade?

    2.
    I use the following in-line script to insert a date on numerous pages ('today' is derived in an external script)

    <script language="JavaScript1.2" type="text/javascript">
    <!--
    document.write('<div class="date">'+today+'</div>');
    //-->
    </script>

    The validator flags </div> stating that there is no starting <div>. What's the problem?

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    1. That should really be body {margin:0px} and users of version 4 browsers do need to upgrade. However, said users - and users in general - really don't give a south end of a north bound rat about your margins.

    2. It sounds like there might be something else going on, but try the following:

    <script type="text/javascript">
    <!--
    document.write('<div class="date">'+today+'<\/div>');
    //-->
    </script>

    And note that using the LANGUAGE attribute with the SCRIPT element will put Netscape in a special standards non-compliant mode. Said attribute was depricated for a reason and unless you're using some legacy DTD the validator ought to flag that.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132
    Thanks Charles. The <\/div> solved the second part. It's possible that the <div class="date"> was not considered a valid opening <div> tag!

    users of version 4 browsers do need to upgrade. However, said users - and users in general - really don't give a south end of a north bound rat about your margins.
    Here's why (I think) I need to zero the margins.
    I'm using a 'repeat-x' background image at the top of my page which needs (I want) to go up against the edge. I then match other images over the top of this. So the position of these images is important. In addition, on other pages, I use 'position:absolute' (required if using DHTML in NS4xx) to position other image-type effects that need to match over existing images.

    If I do not zero the margins, the images do not position correctly. Also the 'default' margin in NS4xx seems to vary depending
    on screen size so I cannot use the defaults as a starting point. Does that make sense??
    Last edited by Nedals; 01-19-2003 at 03:51 PM.

  4. #4
    Join Date
    Jan 2003
    Posts
    136
    Don't need a unit when the value is 0. Also use 'padding: 0' since Opera applies padding, not margin, to body by default.

    The usual hack for NS4 is as follows. It will get rid of the left and top margins. You are stuck with the right margin, but that's mostly good enough.

    Code:
    body        { margin: -10px 0 0 -10px }
    html body   { margin:0; padding: 0 } /*Nav doesn't get this*/
    YUPAPA Webhosting ~~~
    Support
    meow at yupapa dot com
    http://yupapa.com

  5. #5
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132

    Thumbs up

    Perfect!! Thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles