Jump to content

[SOLVED] Making a span height 100% of the div...


mattal999

Recommended Posts

I have this code:

 

<span style="float:right;width:150px;height:100%;padding-left:10px;border-left:1px dotted #3d3d3d;"> 

 

Which SHOULD make the span 100% of the div. Of course, it only displays the border up to the point where the text in the span goes up to. I need to make this longer than it currently is, and go to the height of the other span. The other span contains a lot of dummy text, which is a lot longer than this span.

 

The actual page: http://iwantthatone.comuf.com/modules/scrapz/

 

Thanks

Link to comment
Share on other sites

span is inline. It will only take up the amount of space the text takes up. Make sure you declare - "display: block;" to make it expand to your desired width/height.

 

Edit - you have float: left; which "implies" display: block;" therefore putting the display declaration is unnecessary but a good practice.

 

I don't like the use of <span> in this scenario. Span is inline and should only be used to style text color, font-weight, or other text feature. If you want to lay things out, use a block level tag such as <p> or <h1> or <div>.

 

What exactly do you want to accomplish? Floating something to the left will always shrink wrap it, unless you specify a width.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.