Aldona wrote:
> What I want to do is put a border around the paragraph (not the image so
> it goes around the text as well). What happens is the border winds up
> the width of the whole page even though I have margin and padding set to
> zero.

Since paragraphs are block level elements, stretching to fill the
available area is what would be expected in this case. Setting margin
and padding to zero would actually ensure that your paragraph did
exactly that.

> How can I stop the border stretching the entire width of the page.
> Unfortunately in this case float is not an option and I have a
> limitation in that the HTML needs to remain as basic as possible. The
> CSS can be as complicated as anything but the HTML needs to be simple.

Without floating, your only option that I can imagine would be applying
display:inline-block on the paragraph element. In theory, this should
cause a sort of shrink-wrap effect on the paragraph allowing it to
shrink to the size of the content (in this case, your image) and then
apply a border.

This code appeared to work for me on FF3/Ubuntu:
<p style="border:2px solid #000;display:inline-block;">
  <img src="http://www.google.com/intl/en_ALL/images/logo.gif";><br>
  Regular Image
</p>
...but bear in mind, you'll need to apply adjustments for some versions
of Internet Explorer and FF lte 2 (and maybe others).

Hope it helps.
--Bill

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TheHolierGrail.com | MacNimble.com | Cyber-Sandbox.com | Anytowne.com
Bill Brown, Web Developer - "From dot concept to dot com since 1999"
"The intuitive mind is a sacred gift and the rational mind is a
faithful servant. We have created a society that honors the servant and
has forgotten the gift. -- Albert Einstein
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to