Give help. Get help.

  • # June 15, 2008 at 11:04 pm

    I am using <span> in my markup. It has to be there. What I need to know is how I can add a width to the span tag. I have a background color for the text inside the span tag, but it ends at the end of the tag. I tried to add a width property. but it doesn’t work. I need the background color to span farther than the text inside the tag. The only way i can find to do that right now is by adding &nbsp; but this isn’t an exact measurement so it’s not perfect. is there anything i can do here?

    # June 16, 2008 at 2:33 am

    Try adding display: block; to your style for the span(s) in question. Inline elements don’t hold dimensions the same as block elements. One thing to note here is that if you change the display from inline to block you may have to float the element(s) as well, depending on how you want the layout to flow. Hope this helps.

    Best Regards,

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.