Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can I specify the width of a p tag?

27,903 views
Skip to first unread message

Pliss...@gmail.com

unread,
May 27, 2007, 11:53:32 PM5/27/07
to
Hi,

How can I specify the width for the text under a p tag?

I tried "<p width="100">", the text does not wrap around at 100 pixel.
and I tried '<p> <div style="width:100px">" but the location of the
text get push down to the bottom.

I think the <p> has a <div> parent which has it owns width & height in
css style.

Thank you for any suggestion.

Gus Richter

unread,
May 28, 2007, 12:49:15 AM5/28/07
to

<p style="width:100px;">

--
Gus

David E. Ross

unread,
May 28, 2007, 11:36:11 AM5/28/07
to

I strongly recommend against non-relative widths (e.g., pixel widths).
Use percentage widths so that the result adapts to different window
sizes. Few things are as annoying in a page as one that must be
scrolled right-left again and again to read.

--

David E. Ross
<http://www.rossde.com/>.

Anyone who thinks government owns a monopoly on inefficient, obstructive
bureaucracy has obviously never worked for a large corporation. © 1997

Miroslav Asenov

unread,
May 29, 2007, 2:31:39 AM5/29/07
to
David E. Ross wrote:
> Gus Richter wrote:
>> Pliss...@gmail.com wrote:
>>> Hi,
>>>
>>> How can I specify the width for the text under a p tag?
>>>
>>> I tried "<p width="100">", the text does not wrap around at 100 pixel.
>>> and I tried '<p> <div style="width:100px">" but the location of the
>>> text get push down to the bottom.
>>>
>>> I think the <p> has a <div> parent which has it owns width & height in
>>> css style.
>>>
>>> Thank you for any suggestion.
>> <p style="width:100px;">
>>
>
> I strongly recommend against non-relative widths (e.g., pixel widths).
> Use percentage widths so that the result adapts to different window
> sizes. Few things are as annoying in a page as one that must be
> scrolled right-left again and again to read.
>
<p style="width:50%"> .... </p>
0 new messages