Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Fixing the space between li's and images in html

I was wondering if there was a more simple way of removing the tiny space between li's and images without needing css? This is how I am currently fixing it, but I would rather have a much reader friendly way of doing this.

Space Removed
<ul><li>
  1</li><li>
  2</li><li>
  3</li>
</ul>
vs
Space NOT removed
<ul>
  <li>1</li>
  <li>2</li>
  <li>3</li>
</ul>

----------
Space Removed
<img src="1.jpg"><img src="2.gif"><img src="3.png">
vs
Space NOT removed
<img src="1.jpg">
<img src="2.gif">
<img src="3.png">

2 Answers

No, I don't think so. Visual style is what CSS is for. You're going to use it anyway, why not use it to get rid of the spaces you are trying to remove? It's probably more important as a developer to have code that you (or other developers) can read and understand. Also, you don't want the correct appearance to be dependent on a particular formatting of the HTML.

Alright, thank you!