[html/css] Advert banner like wJ

Status
Not open for further replies.

jayfella

Active Member
1,600
2009
565
700
Ok.

So the advert banner on wJ is pretty sexy. Nice rounded corners, pretty cool. Here's my interpretation of how i would go about coding it from scratch.

Credits to the original creator - its a re-write, not a rip :)

Im not sure how the original was written, but this version allows any width of advert, so you can span it however wide you like and it will retain its look.

Images: http://hotfile.com/dl/52067516/a3d1da3/images.rar.html

CSS:
PHP:
#mainHoriz {background: #ddd; height: 60px;}
.leftBox { float: left; background: url(images/leftBox.png) no-repeat; height: 60px; width: 7px; position: relative; z-index: 5;}
.midBox { float: left; background: url(images/midBox.png) repeat-x; height: 60px; margin-left: -4px;}
.rightBox { float: left; background: url(images/rightBox.png) no-repeat; height: 60px; width: 7px; margin-left: -5px; position: relative; z-index: 5;}
.adImg { position: relative; z-index: 4; margin-top: 3px;}
HTML:
PHP:
<div id="mainHoriz">

    <div class="leftBox"></div>
    <div class="midBox">
        <img class="adImg" src="http://www.wjunction.com/images/ads/advert2.gif" />
    </div>
    <div class="rightBox"></div>
    
    <div class="leftBox"></div>
    <div class="midBox">
        <img class="adImg" src="http://www.wjunction.com/images/ads/advert2.gif" />
    </div>
    <div class="rightBox"></div>
    
    <div class="leftBox"></div>
    <div class="midBox">
        <img class="adImg" src="http://www.wjunction.com/images/ads/advert2.gif" />
    </div>
    <div class="rightBox"></div>
    
    <div class="leftBox"></div>
    <div class="midBox">
        <img class="adImg" src="http://www.wjunction.com/images/ads/advert2.gif" />
    </div>
    <div class="rightBox"></div>
    
</div>
Le resulte:

[slide]http://www.imgcentre.com/img/uploads/big/045cdd0605.png[/slide]

Ok.
The background is grey so you can see how this is constructed. You can easily repeat-x a pretty little bar. The left, mid and right of the "transparent" rounded box is also easily modified.

Have fun :)
 
9 comments
not bad but you may wanna add classes for the width, eg class="1" would give you one ad space, class="2" would give you two it be fairly simple i think
 
Status
Not open for further replies.
Back
Top