/    Sign up×
Community /Pin to ProfileBookmark

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 [url]http://validator.w3.org[/url] 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?

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@CharlesJan 19.2003 — [font=georgia]1. That should really be [font=monospace]body {margin:0[b]px[/b]}[/font] 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:

    [font=monospace]

    <script type="text/javascript">

    <!--

    document.write('<div class="date">'+today+'<[b][/b]/div>');

    //-->

    </script>[/font]

    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.[/font]
  • Copy linkTweet thisAlerts:
    @NedalsauthorJan 19.2003 — 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.
    [/quote]


    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??
    Copy linkTweet thisAlerts:
    @meowJan 19.2003 — 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.

    <i>
    </i>body { margin: -10px 0 0 -10px }
    html body { margin:0; padding: 0 } /*Nav doesn't get this*/
    Copy linkTweet thisAlerts:
    @NedalsauthorJan 19.2003 — Perfect!! Thanks.
    ×

    Success!

    Help @Nedals spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.19,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...