August 30, 201115 yr hi, i have this problem with a web design im doing for my new website, i have an image that i want to apply to a div which is my container div that holds all my other divs, but not apply a height so that when the content changes on each page the image will just shorten n expand on its own( its a gradient image nothing special), but when i apply no height to the container div, the image doesnt show, even if i try a colour it doesnt work, what im wanting is for the container div to display the image with no height property can you have a look at the css and html and help me out it would be much appreciated here is the link http://ellensalterations.co.uk/david2/index.html i have supplyed the link because to paste the code would have made this post even longer. any help would be much appreciated Collie
August 30, 201115 yr Odd that the 'black' is not working... Cant spot anything obvious. With the background image property, it normally works better like this: background-image:url('images/content2.png'); Note the 'single quotes'... Also, maybe try: background-position:top; ?? HTH
August 30, 201115 yr Author i tried that, didnt work, i added both the "background-position:top" and the single quotes and nothing happened :S, so annoying been trying to fix it for a while, im not wanting to have a different container for each page, that will just make the code even more a mess than it is
August 30, 201115 yr </div<!-- end of header --> That div tag is missing the closing '>' Then try the quotes etc again.. HTH Edited August 30, 201115 yr by greyhat
August 30, 201115 yr Author i never even notice the missing ">" i fixed that n kept the quotes in and its still not working, this is starting to do my head in lol, i appreciated all the help man
August 30, 201115 yr Yh did u try the css fix?? U cant have 3 values in that property.. it should be 0px auto... To center the div...
August 30, 201115 yr * also, this is wrong: margin: 30px auto 10px; Is that not 30px top, auto left & right, 10px bottom ?
August 30, 201115 yr Is that not 30px top, auto left & right, 10px bottom ? ... mayb i am wrong.. sorry i just never used it that way b4.
August 30, 201115 yr Author i tried changing it to "margin:0 auto;" & "margin:0px auto;" still not working :(
August 30, 201115 yr You had a script tag missing and I've changed it to the latest jquery lib on google <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script type="text/javascript" src="http://ellensalterations.co.uk/david2/scripts/jquery.nivo.slider.pack.js"></script> <script type="text/javascript"> $(window).load(function() { $('#slider').nivoSlider(); }); </script>
August 30, 201115 yr Author You had a script tag missing and I've changed it to the latest jquery lib on google <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script type="text/javascript" src="http://ellensalterations.co.uk/david2/scripts/jquery.nivo.slider.pack.js"></script> <script type="text/javascript"> $(window).load(function() { $('#slider').nivoSlider(); }); </script> i copyed that code into mine, re-uploaded it to the server, and its still not working, this is so annoying cause i like the design, but its looking like i wont be able to
August 31, 201115 yr Just add the overflow property to your container div man. #container { overflow: hidden; } You can also add a clearfixhack if you need visible overflow.
August 31, 201115 yr You'll need another container outside of your current container: <div id="container-main"> <div id="container"> All your content </div> </div> CSS: #container-main{ margin: 0 auto; width: 900px; } #container { background-color: black; background-image: url("images/content2.png"); background-repeat: repeat; border-radius: 5px 5px 5px 5px; box-shadow: 3px 3px 10px #000000; float: left; } Make sure you put the float: left on #container no heights needed
August 31, 201115 yr Author thanx everyone for your help and @pedro and @ i-am-css both what use said worked perfect, thanx alot
Create an account or sign in to comment