View Full Version : body background

08-10-2012, 11:21 AM
Hello, when I assign the background-image to body the image fill all the page but i would like to left two lateral white strips starting from the table border, do you know how can I do this?

here two image and the html code, how it appears and how I would like it to appear... thank you :)



<body style="background-image: url(bkg.jpg)">
style="text-align: left; width: 900px; height: 113px; margin-left: auto; margin-right: auto;"
border="1" cellpadding="2" cellspacing="2">
<td style="vertical-align: top;"><br>
<h2 style="text-align: center;">TITOLO</h2>

08-10-2012, 01:04 PM
Assign a width of 900px to the body (and margin: auto).

08-10-2012, 01:33 PM
do you know how can I do this?
<!doctype html>
<html lang="en-US">
/* Defaults */
* { margin: 0; padding: 0; }
section { display: block; }

/* Layout */
html { height: 100%; height: 100%; }
#layout { width: 900px; min-height: 100%; margin: 0 auto; }
#box { min-height: 113px; border: 3px ridge; }
section { margin-top: 2em; }

/* Typography */
h1 { text-align: center; text-transform: uppercase; font-size: 1.5em; }

/* Color Scheme */
html { background-color: white; color: black; }
#layout { background: lightgray url("bkg.jpg"); color: black; }
#box { border-color: silver; }
<!--[if lte IE 8]>
document.createElement("section"); /* WIE8 does not allow styling of the HTML5 section element without first creating it via JavaScript. */
<div id="layout">
<div id="box"></div>
<h1 lang="it">Titolo</h1>