Jump to content

text in margins


niche
 Share

Recommended Posts

what exactly do you mean by the 10px margin? the spacing between the 4 squares? If so try adding a div with height 10px and then writing in it.like so:

<html><head><style type="text/css">div.ex{width:730px;height:1005px;margin:0px 0px 0px 16px;margin-left:16px;padding:0px;border:5px solid gray;}div.twoup_left{float:left;width:344px;height:149px;margin:0px 0px 0px 10px;border:3px solid gray;}div.twoup_right{float:right;width:344px;height:149px;margin: 0px 10px 0px 0px;border:3px solid gray;}div .margin_text{	height:10px !important;	font-size: 9px;	vertical-align: middle;	text-align:center;}</style></head><body><div class="ex">  <div class="margin_text"> </div>  <div class="twoup_left" >  </div>  <div class="twoup_right" >  </div>  <div class="margin_text">Text Here....</div>  <div class="twoup_left" >  </div>  <div class="twoup_right" >  </div></div></body></html>

Link to comment
Share on other sites

The only way to "write in a margin" is to use positioning. I would probably add position: relative to the twoup_left divs and put the text in an absolutely positioned div child.EDIT:Actually, I take that back. You can add a div like dzhax suggested, but give it a width of 10px, and a negative right margin of 10px. That should negate any space it would occupy, effectively positioning it "inside" the margins of adjacent elements.

Edited by ShadowMage
Link to comment
Share on other sites

So, is it accurate to say that you can't embed text directly into a margin but you can float/position boxes that mimic margins and place text in them?

Link to comment
Share on other sites

So, is it accurate to say that you can't embed text directly into a margin but you can float/position boxes that mimic margins and place text in them?
That would be a good way to put it.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...