right side of margin 2px are ignored on div w 100% width

RESOLVED INVALID

Status

--
major
RESOLVED INVALID
14 years ago
14 years ago

People

(Reporter: dvanbrunt, Unassigned)

Tracking

Trunk
x86
Windows XP

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040803
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040803

When I add the following style to a div the right margin is ignored and the div
touches the edge of the page. The body is set to margin:0px

.divtag {
	background-color: #0099FF;
	height: 300px;
	width: 100%;
	margin: 2px;
}

Reproducible: Always
Steps to Reproduce:
1.create basic HTML page
2.add style to body setting margin:0px
3.create a div tag within the body of the HTML page
4.add the following style to the div
.divtag {
	background-color: #0099FF;
	height: 300px;
	width: 100%;
	margin: 2px;
}
5.Knowtice that the right margin of the div is missing and the div touches the
right side of the window.



I have so far had to use a work around to fix this problem.
I place the 100% width div inside a div with padding 2px.
same desired result but with more code.

Comment 1

14 years ago
Dupe of Bug 212154 (invalid)?
(Reporter)

Comment 2

14 years ago
(In reply to comment #1)
> Dupe of Bug 212154 (invalid)?
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → INVALID

Comment 3

14 years ago
For further explanation (the behaviour of Mozilla here) is defined in the specs,
see Bug 242719 Comment 1 for the details.
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.