css position:absolute problem -



css position:absolute problem -

i have css problem. here need.

no matter how many words title have(example: title what's new today?, hello world)

it have background line pass through whole div, , word's background white. (the word should text-align:center; , it's background looks broken line)

here code:

<style> .ocell { width:960px; height:42px; text-align:center; padding: 20px 0 20px 0; } .wd { margin: 0 auto; background-col: white; margin-left: -10px; padding: 5px; } .line { position: absolute; border-bottom: solid 1px #999; margin-top:-18px; width: 960px; } </style> <div class="ocell"> <div class="wd">title</div> <div class="line"></div> </div>

also in http://jsfiddle.net/zapla/ may can utilize background-image instead of line. thanks.

this can achieved using div border-bottom line, , positioning element text on line. fiddle here.

css

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -