How to make divs reach edges of browser window?

P

puzzled

I have looked and looked and not found the answer to this one - just
lots of references to this or that "hack" that is supposed to fix the
problem (and it is a problem to some people).

If I have a div specified and want it to reach across the full width
of the browser window, it doesn't. There is an approximately 10-pixel
margin on either end of the div. I can "fix" this by setting my left
and right margins to -10px, but by doing so, I get the feeling that
I'm doing something that was never intended.

So first, why DON'T div's naturally, as far as I can tell, touch the
edges of the browser window. And second, what is the right/best/
least worst/"correct" way to make them touch the browser window edges.

See the following html:

<html>
<head>

<style type="text/css">
<!--
..bluearea {
margin: 0px;
padding: 5px;
width: auto;
color: white;
background-color: blue;
}
..redarea {
margin-left: -10px;
margin-right: -10px;
padding: 5px;
width: auto;
color: white;
background-color: red;
}
-->
</style>

</head>
<body>

<div class="bluearea">
Why does this blue band not touch the edges of the browser window?
</div>

<div class="redarea">
While this red band does?
</div>

</body>
</html>
 
W

William Tasso

puzzled said:
I have looked and looked and not found the answer to this one - just
lots of references to this or that "hack" that is supposed to fix the
problem (and it is a problem to some people).

If I have a div specified and want it to reach across the full width
of the browser window, it doesn't. There is an approximately 10-pixel
margin on either end of the div. I can "fix" this by setting my left
and right margins to -10px, but by doing so, I get the feeling that
I'm doing something that was never intended.

So first, why DON'T div's naturally, as far as I can tell, touch the
edges of the browser window. And second, what is the right/best/
least worst/"correct" way to make them touch the browser window edges.

body {margin:0, padding:0;}
 
P

puzzled

body{margin:0;padding:0;}

+-------

Thanks people. I swear I spent three hours trying to find the answer
before posting.
 
S

Stan Brown

It seems "DU" wrote in comp.infosystems.www.authoring.stylesheets in
article said:

I guess they really _are_ unknown. I visited the above page and got
"unknow [sic] or not available" for every one except the one labeled
MSIE, which said "not available".

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
 
S

Stan Brown

It seems "rf" wrote in comp.infosystems.www.authoring.stylesheets in
article said:
Ah, but what EST? I'll just bet it means eastern standard USA time, not EST
Australia :)

That's AEST not EST, according to
http://www.koalanet.com.au/wtzabb.html
Note what country hosts that page.
seems to be a complete list. Anyone know where (or if) there's an
ISO standard list on line?

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
 
T

Toby A Inkster

Stan said:
Anyone know where (or if) there's an ISO standard list on line?

Names of timezones have never been standardised, but a good
pseudo-standard might be the table in getdate.c, part of the GNU
"sh-utils" package.

The table is reproduced below, and may be distributed under the GPL.
http://www.gnu.org/copyleft/gpl.html

/* The time zone table. This table is necessarily incomplete, as time
zone abbreviations are ambiguous; e.g. Australians interpret "EST"
as Eastern time in Australia, not as US Eastern Standard Time.
You cannot rely on getdate to handle arbitrary time zone
abbreviations; use numeric abbreviations like `-0500' instead. */
static table const time_zone_table[] =
{
{ "GMT",tZONE, HOUR ( 0) },/* Greenwich Mean */
{ "UT",tZONE, HOUR ( 0) },/* Universal (Coordinated) */
{ "UTC",tZONE, HOUR ( 0) },
{ "WET",tZONE, HOUR ( 0) },/* Western European */
{ "WEST",tDAYZONE, HOUR ( 0) },/* Western European Summer */
{ "BST",tDAYZONE, HOUR ( 0) },/* British Summer */
{ "ART",tZONE, -HOUR ( 3) },/* Argentina */
{ "BRT",tZONE, -HOUR ( 3) },/* Brazil */
{ "BRST",tDAYZONE, -HOUR ( 3) },/* Brazil Summer */
{ "NST",tZONE, -(HOUR ( 3) + 30) },/* Newfoundland Standard */
{ "NDT",tDAYZONE,-(HOUR ( 3) + 30) },/* Newfoundland Daylight */
{ "AST",tZONE, -HOUR ( 4) },/* Atlantic Standard */
{ "ADT",tDAYZONE, -HOUR ( 4) },/* Atlantic Daylight */
{ "CLT",tZONE, -HOUR ( 4) },/* Chile */
{ "CLST",tDAYZONE, -HOUR ( 4) },/* Chile Summer */
{ "EST",tZONE, -HOUR ( 5) },/* Eastern Standard */
{ "EDT",tDAYZONE, -HOUR ( 5) },/* Eastern Daylight */
{ "CST",tZONE, -HOUR ( 6) },/* Central Standard */
{ "CDT",tDAYZONE, -HOUR ( 6) },/* Central Daylight */
{ "MST",tZONE, -HOUR ( 7) },/* Mountain Standard */
{ "MDT",tDAYZONE, -HOUR ( 7) },/* Mountain Daylight */
{ "PST",tZONE, -HOUR ( 8) },/* Pacific Standard */
{ "PDT",tDAYZONE, -HOUR ( 8) },/* Pacific Daylight */
{ "AKST",tZONE, -HOUR ( 9) },/* Alaska Standard */
{ "AKDT",tDAYZONE, -HOUR ( 9) },/* Alaska Daylight */
{ "HST",tZONE, -HOUR (10) },/* Hawaii Standard */
{ "HAST",tZONE, -HOUR (10) },/* Hawaii-Aleutian Standard */
{ "HADT",tDAYZONE, -HOUR (10) },/* Hawaii-Aleutian Daylight */
{ "SST",tZONE, -HOUR (12) },/* Samoa Standard */
{ "WAT",tZONE, HOUR ( 1) },/* West Africa */
{ "CET",tZONE, HOUR ( 1) },/* Central European */
{ "CEST",tDAYZONE, HOUR ( 1) },/* Central European Summer */
{ "MET",tZONE, HOUR ( 1) },/* Middle European */
{ "MEZ",tZONE, HOUR ( 1) },/* Middle European */
{ "MEST",tDAYZONE, HOUR ( 1) },/* Middle European Summer */
{ "MESZ",tDAYZONE, HOUR ( 1) },/* Middle European Summer */
{ "EET",tZONE, HOUR ( 2) },/* Eastern European */
{ "EEST",tDAYZONE, HOUR ( 2) },/* Eastern European Summer */
{ "CAT",tZONE, HOUR ( 2) },/* Central Africa */
{ "SAST",tZONE, HOUR ( 2) },/* South Africa Standard */
{ "EAT",tZONE, HOUR ( 3) },/* East Africa */
{ "MSK",tZONE, HOUR ( 3) },/* Moscow */
{ "MSD",tDAYZONE, HOUR ( 3) },/* Moscow Daylight */
{ "IST",tZONE, (HOUR ( 5) + 30) },/* India Standard */
{ "SGT",tZONE, HOUR ( 8) },/* Singapore */
{ "KST",tZONE, HOUR ( 9) },/* Korea Standard */
{ "JST",tZONE, HOUR ( 9) },/* Japan Standard */
{ "GST",tZONE, HOUR (10) },/* Guam Standard */
{ "NZST",tZONE, HOUR (12) },/* New Zealand Standard */
{ "NZDT",tDAYZONE, HOUR (12) },/* New Zealand Daylight */
{ 0, 0, 0 }
};
 
R

rf

Toby A Inkster said:
Names of timezones have never been standardised, but a good
pseudo-standard might be the table in getdate.c, part of the GNU
"sh-utils" package.

The table is reproduced below, and may be distributed under the GPL.
http://www.gnu.org/copyleft/gpl.html

/* The time zone table. This table is necessarily incomplete, as time
zone abbreviations are ambiguous; e.g. Australians interpret "EST"
as Eastern time in Australia, not as US Eastern Standard Time.
You cannot rely on getdate to handle arbitrary time zone
abbreviations; use numeric abbreviations like `-0500' instead. */

brucie (see his sig) use military time. It's now 13:29Kilo.

http://www.koalanet.com.au/milabb.html

<snip table which, I notice, fails to include Australia, even though it does
include those kiwis across the puddle>

Cheers
Richard.
 
D

Duende

While sitting in a puddle rf scribbled in the mud:
<snip table which, I notice, fails to include Australia,

K Kilo UTC +10 hours Vladivostok (Russia), Papua New Guinea, Eastern
Australia
 
R

rf

Duende said:
While sitting in a puddle rf scribbled in the mud:


K Kilo UTC +10 hours Vladivostok (Russia), Papua New Guinea, Eastern
Australia

Sorry Duende, my quoting was a bit off. The table I snipped containing the
missing Australia stuff was the one posted by Toby, not the one at the URL I
quoted.

In any case K is still not adequate. Sydney and Vladivostok have
diametrically opposed views on when daylight saving operates :)

<grin> Even brucie up in QLD runs on a different clock at the moment.
</grin>

Cheers
Richard.
 
B

brucie

In any case K is still not adequate. Sydney and Vladivostok have
diametrically opposed views on when daylight saving operates :)

<grin> Even brucie up in QLD runs on a different clock at the moment.
</grin>

QLD is on real time, not make-it-up-as-we-go NSW time
 
R

rf

Mark Parnell said:
It's not in his sig any more.

You're right.
I think he changes his sig more often that
his underpants. :)

Maybe he read one of his own posts and suddenly found out that it was
<shudder> daytime </shudder> outside.

Cheers
Richard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,044
Latest member
RonaldNen

Latest Threads

Top