Re: Background image excluding margins

Chris Beall <[email protected]>
Newsgroups gmane.comp.web.amaya.general
Message-ID <[email protected]>
A case can be made for either implementation.

BUT, what happens if you place the style on the <body> element?

See http://www.w3.org/TR/CSS21/colors.html#background

Note the paragraph starting "For HTML documents..." (which includes XHTML as well), the recommendation is to promote any 'background properties' on the <body> element to the parent root element.  Nothing is said about similarly promoting other properties, such as margins.  Thus placing your styling on the <body> element should have the desired effect: the background fills the canvas and the margins are imposed on all subsequent content.

I do not have the ability to test this.  Perhaps someone else can report results.

As I recall, the results of styling the <html> element are inconsistent across browsers and therefore best avoided.

Chris Beall


--- On Thu, 8/13/09, José Carlos Santos <[email protected]> wrote:

From: José Carlos Santos <[email protected]>
Subject: Background image excluding margins
To: [email protected]
Date: Thursday, August 13, 2009, 5:31 AM

Hi all,

Imagine a HTML page which uses a stylesheet containing a line like:

html {margin-left: 4% ; margin-right: 4% ; background-color: white ;
 background-image: url(sandston.gif) }

When I see such a file with Amaya, the background image also obeys the
"margin-left: 4% ; margin-right: 4%" request. In other words, the image
doesn't extend to the border. Is this the intended behavior? With any
other browser that I have access to, the request concerning the margins
applies to text alone, and I think that that's how it should be.

Best regards,

Jose Carlos Santos
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.