Forum Moderators: open
<head>
<title>test</title>
</head>
<body bgcolor="#006699" link="#FFFFFF" vlink="#FFFFFF">
<table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#81ABAB">
<tr>
<td width="33%" valign="middle" align="center" bgcolor="#81ABAB"><img border="0" src="newlogo.jpg" width="312" height="58"></td>
<td width="27%" valign="bottom" align="center">
Thanks
is that enough ?
<body bgcolor="#333333" text="#000000" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
The line of code above is similar to Gethan's, but he missed the marginheight="0"
topmargin + leftmargin is one browser
marginheight + marginwidth is another
this works for IE, NN, and opera which follow's the NN variation.
<body marginheight="0" marginwidth="0">
which works not only in IE but also older versions of Netscape (which are generally the most problematic with regard to borders anyway).
However, this is also nonstandard code so try to use the CSS if possible.
I was using the margin=0 but was looking for a better cross-browser solution. However, I can't seem to get the css to work:
<style type="text/css">
body {margin 0px; padding: 0px}
</style>
Is this not how to write it?
I also tried inline:
<body bgcolor="#333333" text="#000000" {margin 0px; padding: 0px}>
Still not working
<body style="margin:0;padding:0;">
Drop the { } when its inline.
Try to use the code in the HEAD section, its easier to track there.
Can skip the px,pt,em, whatever. 0 is 0 ;)
HTH
<body bgcolor="#F0FFFF" text="#000000"
link="#660000" vlink="#660000" style="margin:0;padding:0;">
Works in IE6 , though for some reason I just don't see, it doesn't work from the head tag. I changed it so there was just one declaration but still no dice. Above works though. I'll play with it a few more to see what's holding it up. Alright, this does it in IE6, have to apply it to the HTML element(in the head section) as in
<style type="text/css">
html { margin:0; padding: 0; }
body { /*your other rules here */ }
</style>
Though I believe in IE5 , it will NOT accept a ruleset for the HTML element unless you have a doctype declared. Hopefully, that didn't just totally lose you :)
HTH
[westciv.com.au...]
*waiting for the "it must validate!!" crowd to come forward and lynch me*
Yes I understand about the rogue code not validating. My HTML is solid but I use several codes that kick up flags at validators.
I use width and height inside forms also, but without them the graphics load noticably slower. Also, some C&P affiliate codes use tags that cause "errors" at the W3C val but without them, the application does not work.
My object is to have great looking/functioning pages, not to have good "grades" (he says while keeping head low in anticipation of oncoming stones)
This non-standard code can validate -- if you create a custom DTD. In fact, you'll see on the "Reference" link below that this is one common reason for customizing your DTD.
Reference [htmlhelp.com]
Which specific browser are you referring to?
tedster
>>This non-standard code can validate -- if you create a custom DTD.
Man, I don't know about the validating crowds you hang around with, hacking up the DTD would get cries of "it still isn't w3c standards code" for HTML 4.0 or 4.1. XHTML ,that might be a valid option though I still am not convinced of its validity on changing attributes for already defined elements. Declare a new namespace and provide alternate styles for those, sure, but altering the base elements you might as well just live without the little w3c logo on the page.
>waiting for the "it must validate!"
Contrary. Most of us don't drum the validation mantra too loud (see: goose/gander fable). Mostly, if there is a validating solution to code, we try to encourage it. If it were just you and me, we might do what ever it took to get the page to look the way we want - but we are in an audience here.
If there has ever been more copied code than html, I don't what it would be (maybe the basic "Hello World" program would be it). So, we try to stay away from the browser specific extentions like margin in the body tag. Try something along the lines:
<body style="margin: 0px; padding 0px">
Brett (or anyone), I did use that reference page to create a custom DTD defining the non-standard margin codes in the body statement and using the suggested DOCTYPE at the top of my mark-up.
Questions: Should this DOCTYPE be in every page of the website if the same conditions exist within the mark-up?
Also, this custom DTD document weighs in at a hefty 45k of pure text. Other than a validator, will browsers be downloading this document?
> Perhaps you can explain why Opera
> feels it necessary to give 'body'
> a padding value of 8px,Sure, I can explain it. Pick one of these explanations:
1) It was a dreary Thursday in Norway, and the mood of the developer in charge of Opera's default stylesheet matched the weather. On leaving Opera that day, he noticed that someone had parked 8px from his own parking spot, thereby making it impossible for him to leave. Irritated beyond belief at the insensitivity of that individual, he decided to set Opera's default padding to 8px.
2) It was a bright and sunny day in Norway, when the developer of Opera's default stylesheet made the decision to use the default stylesheet suggested by the W3C as Opera's default. [w3.org...]
Sue