cluce Posted February 19, 2008 Share Posted February 19, 2008 I have a css style sheet that reference my html tags but it wont use my image as a background in my #header section. It only uses colors?? This is strange. I would think If could use a color it wouold use the image too. Does anybody see what could be the problem in my code below: HTML page code : <html xmlns="http://www.w3.org/1999/xhtml"> <head><title></title> </head> <body> <form id="form1" runat="server"> <div id="allpages"> <div id="header"> <uc:Header ID="header1" runat="server" /> </div> <div id="nav"> <uc:Navigation ID="nav1" runat="server" /> </div> <div id="maincontent"> </div> </div> <div id="footer"> <uc:Footer ID="Footer1" runat="server" /> </div> </form> </body> </html> css page: * { font-family: Tahoma, Arial, Helvetica; } body { font-size: 80%; margin: 0; } a { color: #0033cc; } H1 { font-size: xx-large; font-weight: bold; color: #cc0033; } .Pct { font-size: large; font-weight: bold; color: orange; } /* AllPages will allow you to define the width and position of all the pages in the site */ #allpages { margin: auto; width: 750px; border: #ccccff 0px solid; } /* CurrentSurveySection defines the font, width, and border of the current survey link area */ .CurrentSurveySection { width: 270px; } /* question css class defines the font, width, and border of the question grid for a survey*/ .questions { background-color: #ffffff; width: 750px; border: solid 0px #cccccc; } /* the website's header for all pages */ #header { background-image: url(App_Themes/cleanOrange/Images/bg1.jpg); } /* the navigation formatting for all pages */ #nav { text-align: center; background-image: url(App_Themes/cleanOrange/Images/bg.gif); } /* the formatting around the main content areas for all pages as they are contained within a master page*/ #maincontent { padding-right: 10px; padding-left: 10px; padding-bottom: 3px; padding-top: 3px; width: 730px; } /* the website's footer for all pages */ #footer { margin-top: 30px; font-size: smaller; text-align : center; } Quote Link to comment https://forums.phpfreaks.com/topic/91898-it-wont-use-an-image-for-a-background-in-the-header-section/ Share on other sites More sharing options...
dbrimlow Posted February 19, 2008 Share Posted February 19, 2008 The container must be at least the same width and height of the image. If you don't designate a height and width for #header, than it is assumed to have none until content is added to it. Quote Link to comment https://forums.phpfreaks.com/topic/91898-it-wont-use-an-image-for-a-background-in-the-header-section/#findComment-470757 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.