On 23/05/2011 14:28, Bobby Jack wrote:
From: Tim Dawson<[email protected]>
Now I'm trying to get the outline to wrap just the text of the
para. I don't want to set a fixed width (say 'width: 400px;')
because the actual text can vary in width. The best way I've found
so far is to insert a <span> round the text, and put the outline on
that. Is there a better way ?
The<span> option is OK, although you probably won't like how it
displays when the text wraps onto two lines.
An alternative would be to float the paragraph (and then clear the next
element) which will
'auto shrink' its width. But, then, the outline will be full-width if
the text covers - at least - one line and one letter. I think you're
probably after something like:
-------------------------
| Lorem ipsum dolor sit |
| amet |
------------------------
(with apologies to those reading in a non-monospace font)
As far as I'm aware, that's not possible in CSS.
- Bobby
You are right, it doesn't look good if it goes to two lines. Fortunately
the para under the div won't ever do that (the variations in length are
all within one line), and the outlined para within the div is full width
anyway. So I'll have to style both a 'p.outline' and a 'span.outline'
(with better choice of name to avoid confusion) and I should be home and
dry.
Thanks for your help.
--
Tim Dawson
Maolbhuidhe
Fionnphort
Isle of Mull PA66 6BP
01681 700718
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/