cluce Posted March 25, 2009 Share Posted March 25, 2009 I have an image that I am placing as the background image for the background-effect but the only 2way it will display wide enough across the screen is to set the width property to width: 1590px; But that is the only way I know how to get the image to display wide enough for the screen. But when I delete the absolute positioning, I dont need the width property but I need the absolute positioning b/c thats the only way the z-index works. Is there a way to get theset the width the size of whatever screen is displying the page for the background-effect-a tag? <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <link href="Css/Div9.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="background-effect"></div> <form id="form1" runat="server"> <div id="page-container"> <div id="header"> <h1></h1> </div> <div id="main-nav">Main Nav</div> <div id="sidebar-a"> <div class="padding"> </div> </div> <div id="content"> <div class="padding"> </div> </div> <div id="footer">Footer <div id="altnav"> </div> </div> </div> </form> </body> </html> #background-effect-a { z-index: -1; height: 55px; position: absolute; margin: 0; top: 0px; left: 0px; width: 1590px; background-image: url('../Images/top_effect_blue.jpg'); } body { background-position: #ffffff; font-family: Arial, Helvetica, Verdana, Sans-serif; font-size: 12px; color: #666666; background-color: #010159; } .hidden { display: none; } #page-container { width: 800px; margin: auto; overflow:auto; } #header { height: 140px; font-family: 'Ant Olive Cp'; font-size: 32px; font-weight: normal; font-style: normal; padding-left: 5px; background-color: #FFFFFF; background-image: url('../Images/header_bg1.jpg'); } h1 { margin: 0; padding: 15px; font-size: medium; } #main-nav { border-style: none solid solid solid; border-width: 1px; border-color: #FF6600; height: 25px; background-image: url('../Images/nav_bg1.jpg'); } #sidebar-a { border-width: 1px; border-color: #FF6600; float: left; width: 150px; line-height: 18px; border-left-style: solid; height: 446px; background-image: url('../Images/side_bg.jpg'); } #sidebar-a .padding { padding: 25px; } #content { margin-left: 150px; padding-left: 10px; line-height: 18px; background-color: #FFFFFF; height: 446px; border-width: 1px; border-color: #FF6600; border-style: none solid none none; } #content .padding { padding: 25px; } #content h2 { margin: 0; padding: 0; padding-bottom: 15px; } #content p { margin: 0; padding: 0; padding-bottom: 15px; } #footer { border-width: 1px; border-color: #FF6600; border-style: solid none none none; height: 66px; clear: both; text-align: center; background-image: url('../Images/footer_bg1.jpg'); } Link to comment https://forums.phpfreaks.com/topic/151052-background-image-will-not-strecth-across-the-size-of-the-screen/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.