Sent by Matt Wilkie on 21 May 2009 20:08
Dear css-discuss, how might one style the first paragraph, only if it
is emphasized? can it be done without javascript?
Given this html:
<div class="content">
<p><em>An intro paragraph which should be highlighted in some
manner,</em> <em>but the [em] might not apply to whole paragraph in a
single piece.</em></p>
<p>This is a normal paragraph which should be left alone.</p>
</div>
<div class="content".
<p>Thiis normal paragraph which should also be left alone.</p>
</div>
This css *almost* works, except it breaks the paragraph apart if there
is more than one <em> :
/* box and center if 1st paragraph in page is emphasized */
..content > p:first-child > em:first-child {
max-width:35em;
padding: 0.5em;
display: block;
text-align:justified;
margin: 0 10% 0 10%;
}
Perhaps I should be taking another approach altogether?
thanks in advance for your time and thoughts,
--
-matt
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
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/