Forum Moderators: not2easy
But here's what I've run into -- in Explorer, text-indent:-20px; just chops off the part of the first sentence that is supposed to hang. It looks good in Opera.
So I added padding-left:20px; (or margin-left) and Explorer looks great. But then Opera looses the hanging indent and is back to squared off paragraphs. Obviously if I MUST choose, I'll take Explorer for the effect, given its market penetration.
But I don't want to choose. Has anyone found a good cross-browser way to create this effect?
[pre]
<dl>
<dt>Some Text</dt>
<dd>Rest of text here...</dd>
</dl>
[/pre]
Sorry it's not quite what you were after ;) Maybe the other CSS regulars have something to add?
Nick
I would have to test pretty well. The last time I used definition lists the support for them was also inconsistent cross-browser. I don't think the W3c has any strong user agent guidelines for rendering them.
I will still hold out hope for some insight that I'm missing.
you're on the right track and the solution can be found
here [webreview.com] under the section on "Creating Outdents".
their paragraphs don't show the formatting, but I've tested it to check and it works across IE6 NN6.2 and Opera6.05
Suzy
That Page didn't display correctly in my browsers either, but when I took the code and wrote a test page it did work..
so I can only presume that have some other styling in their page which is over-riding their examples..
Or are you saying you tested the code separately and it didn't work in previous versions of Opera?
Suzy
.wrong { text-indent: -3em; }
.hang { text-indent: -3em; margin-left: 3em; }
.large { text-indent: -3em; margin-left: 6em; }
--></style>
</head>
<body>
<p class="wrong">
wrong paragraph wrong paragraph wrong paragraph wrong paragraph wrong paragraph wrong paragraph wrong paragraph wrong paragraph wrong paragraph wrong paragraph
</p>
<p class="hang">
hanging paragraph hanging paragraph hanging paragraph hanging paragraph hanging paragraph hanging paragraph hanging paragraph hanging paragraph hanging paragraph
</p>
<p class="large">
large paragraph large paragraph large paragraph large paragraph large paragraph large paragraph large paragraph large paragraph large paragraph large paragraph large paragraph
</p>
</body></html>
Suzy