March 28, 200917 yr Hello there, I'm trying to create a liquid header using a 1px wide image and a left and right float for the corner images. The problem is i'm using transparent png's and need to position them on the ends of the div container instead of overlapping. (to give them the same transparency) Any insight? <style type="text/css"> body { font: 80% verdana, arial, helvetica, sans-serif; text-align: center; /* for IE */ background-color: #333333; background-image: url(Images/circuit-gradient-380x1050.jpg); } #container { text-align: left; /* counter the body center */ width: 80%; background-image: url(Images/xrepeatheader.png); background-repeat: repeat-x; height: 108px; margin-right: auto; margin-left: auto; } #container #leftcorner { background-image: url(Images/leftcornerheader.png); float: left; height: 108px; width: 27px; } #container #rightcorner { background-image: url(Images/rightcornerheader.png); float: right; height: 108px; width: 27px; } </style> </head> <body> <div id="container"> <div id="leftcorner"></div> <div id="rightcorner"></div> </div> </body> </html> Thanks for your help!
March 30, 200917 yr Not entirely sure the exact output of this one, but your HTML and CSS seems okie to achieve the desired effect. You may want to put overflow: hidden; in your container div just incase the browser just gets that little bit too small. So the corners are appearing out of whack, because they are transparent yeah? They are in the right position, but the vertical repeating graphic in container is kind of wiping out your corners? If thats a wrong assessment please post an image it would really be a lot easier. Another way around this issue if it is the case, is to have 5 divs in total, #container #hdrLeft #cornerLeft #hdrBg #hdrRight (essentially corner right) this way your middle graphic is limited to only the space between the sides as opposed to going to the background of the corners Just float all the divs to the right positions using similar CSS to what you have done already. This is far from optimised, its actually pretty sloppy. Another option you could do is have an unordered list for your head - a little unconventional but you could just apply ids to list items and make it work that way.
Create an account or sign in to comment