Mon, 2008-12-01 20:06
Im trying to have 4 small tiled images displayed for background. Top left would be red, top right yellow, lower left, black, and lower right gray. I tried making a css file with divs to see if the top two would work out, but its not. Can anyone look at this code and let me know what I did wrong or how to make this work? Thanks.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <link rel="stylesheet" title="Disabled for Preview-in-Browser: styles.css" type="text/css" /> <style type="text/css"> <!-- #myDivWithBackgroundTopLeft{ background-image: url(images/back-red.jpg); background-repeat: repeat; background-position: left top; background-attachment: fixed; position: fixed; z-index: auto; width: auto; left: auto; top: auto; } #myDivWithBackgroundTopRight{ background-image: url(images/back-yellow.jpg); background-repeat: repeat; background-position: right top; background-attachment: fixed; position: fixed; z-index: auto; width: auto; top: auto; right: auto; } body { background-color: #CCCCCC; border-bottom: #000000; border-left-color: #003366; border-right-color: #336699; border-top-color: 33ff99; } --> </style> </head> <body> <div id="myDivWithBackgroundTopLeft"> <p>Hi mom!</p> </div> <div id="myDivWithBackgroundTopRight"> <p>Hi mom!</p> </div> <div id="body"> <p>Hi body!</p> <p> </p> <p> </p> <p> </p> <p> </p> </div>
Mon, 2008-12-01 21:01
#1
Example...
Try something like this...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> <link rel="stylesheet" title="Disabled for Preview-in-Browser: styles.css" type="text/css" /> <style type="text/css"> <!-- * { margin: 0; padding: 0; } #myDivWithBackgroundTopLeft { background: transparent url(back-red.jpg) no-repeat left top; } #myDivWithBackgroundTopLeft p { float: left; } #myDivWithBackgroundTopRight { background: transparent url(back-grey.jpg) no-repeat right top; } #myDivWithBackgroundTopRight p { float: none; clear: left; } #content { border: 1px solid #000; width: 50%; margin: 0 auto; overflow: auto; } --> </style> </head> <body> <div id="myDivWithBackgroundTopLeft"> <p>Hi mom!</p> <div id="myDivWithBackgroundTopRight"> <p>Hi mom!</p> <div id="content"> <p>Hi body!</p> <p> </p> <p> </p> <p> </p> <p> </p> </div> </div> </div> </body> </html>
Mon, 2008-12-01 21:22
#2
Thank you, but that didnt
Thank you, but that didnt seem to work. Background colors are not showing up.
Mon, 2008-12-01 21:23
#3
Did you create the images
Did you create the images and make sure your paths are correct?
Works fine here.