plasmy Posted October 3, 2011 Share Posted October 3, 2011 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 More sharing options...
ShadowMage Posted October 3, 2011 Share Posted October 3, 2011 There's really no way to do that with a border....You could have a wrapper div around your element that contains the text: <div id='wrapper'>This is your border text. <div>This is your content element</div></div> Link to comment Share on other sites More sharing options...
dsonesuk Posted October 4, 2011 Share Posted October 4, 2011 <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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.