Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

HTML - Is span the only way to do this?

 
Thread Tools Search this Thread
Old 03-05-2005, 08:23 PM   #1
Default Is span the only way to do this?


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




KiwiBrian
  Reply With Quote
Old 03-05-2005, 08:42 PM   #2
mscir
 
Posts: n/a
Default Re: Is span the only way to do this?

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 Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump