JoJo
JoJo

Reputation: 20115

IE6/7 literally interpret whitespace in list items

How do you get Internet Explorer 6 and 7 to not literally interpret whitespace and line breaks in HTML list items? In the image below, I have marked the undesired whitespace in red. I would prefer to not squeeze everything into one giant line of code. It's very hard to read that way. Is there a CSS alternative?

http://img834.imageshack.us/img834/8583/listdu.png

<ol>
 <li>
  <img>
  Sentence 1
  Sentence 2
 </li>
 <li>
  <img>
  sentence
 </li>
 <li>
  sentence
 </li>
</ol>

Upvotes: 0

Views: 128

Answers (2)

methodin
methodin

Reputation: 6712

Here is some useful information Closing gaps in ie

Upvotes: 2

Ascherer
Ascherer

Reputation: 8093

Use a different browser? haha, but in all seriousness, i would suggest just formatting your code to show it properly. Perhaps encapsulating the sentances in spans could do it

<ol>
 <li>
  <img>
  <span>Sentence 1</span>
  <span>Sentence 2</span>
 </li>
 <li>
  <img>
  <span>sentence</span>
 </li>
 <li>
  <span>sentence</span>
 </li>
</ol>

Upvotes: 0

Related Questions