Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Is span the only way to do this?

Reply
Thread Tools

Is span the only way to do this?

 
 
KiwiBrian
Guest
Posts: n/a
 
      03-05-2005
If I have some text strings on a page, e.g. headings, or paragraphs, and I
want them to have a background colour behind just the text, is use of the
span tag surrounding/enclosing the text the only way of achieving this?
Of course I would want it to adjust to any client resizing of the text, or
if characters were added or removed in the source.
I was surprised to find that paragraphs are the width of their container and
not the width of the text string, but no doubt there is a good reason for
this.

TIA
Brian Tozer


 
Reply With Quote
 
 
 
 
mscir
Guest
Posts: n/a
 
      03-05-2005
KiwiBrian wrote:

> If I have some text strings on a page, e.g. headings, or paragraphs, and I
> want them to have a background colour behind just the text, is use of the
> span tag surrounding/enclosing the text the only way of achieving this?
> Of course I would want it to adjust to any client resizing of the text, or
> if characters were added or removed in the source.

....
> TIA
> Brian Tozer


Try applying a background-color to the various page elements, or a span.
Using a span for inline text is probably the easiest way to do what you
want.

http://www.blooberry.com/indexdot/cs...bg/bgcolor.htm
http://www.codeave.com/css/code.asp?u_log=4007
http://www.w3schools.com/css/tryit.a...ext_background

Mike
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm looking for html cleaner. Example : convert <h1><span><font>my title</font></span></h1> => <h1>my title</h1>… Stéphane Klein Python 2 03-30-2010 12:35 AM
Re: I'm looking for html cleaner. Example : convert <h1><span><font>my title</font></span></h1> => <h1>my title</h1>… Stefan Behnel Python 0 03-29-2010 08:14 PM
Can span include span? Fulio Open HTML 5 06-26-2009 10:24 PM
DataGrid (body only) contained in <span>...</span> tags Dan Bishop ASP .Net Datagrid Control 2 06-07-2004 04:00 PM
Enable drag and drop to the text between <span></span> Wang, Jay Javascript 5 05-25-2004 09:33 PM



Advertisments