Jump to content

Text In Border


plasmy

Recommended Posts

I want to take a tag in html and add a text to a border. Example -----Text Here-------------------| __________ || __________ |------------------------------------ I want to know how to put the "Text Here". Any suggestions?

Link to comment
Share on other sites

<div id="wrapper"><div id="top_border_text_outer"><div id="top_border_text"><p>Text Here</p></div></div><div><p>This is your content element</p></div></div>

with

#wrapper {width:960px; min-height:700px; margin: 0 auto; border: 2px solid lime; }#top_border_text_outer {/*text-align:center;*/  position:relative; padding-top:1px;} /* to center border text uncomment text-align:center*/#top_border_text { position:absolute; top:-12px; /*left:50%; float:left;*/}/* to center border text uncomment left:50%; float:left;*/#top_border_text p{  /*position:relative; right:50%;*/ background-color:#FFFFFF; margin:0;}/* to center border text uncomment position:relative; right:50%;*/

Edit: padding-top:1px; is required for IE7 collapsing margins issue

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...