This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by fferna07
over 8 years

How do I make an image go below the other rather than next to it?

If I have two images, how do I arrange the code so that the second will go below the first one rather than next to it. When I preview the page, the two images keep showing up next to each other.

Answer 55e2e35851b887dc0900031c

0 votes

Permalink

images are inline elements, which means they will arrange themselves besides each other unless you specify different. There are a few things you can do, the easiest (and dirtiest) way is to insert a break:

<img src="#">
<br>
<img src="#">

Or you could wrap your images inside a div:

<div>
  <img src="#">
</div>
<div>
  <img src="#">
</div>

or you could tell your image to behave like a block, rather then wrapping a block around it:

<style>
  img { display: block; }
</style>

All this will be explained in the course later on (except for the break, but the break is easy)

points
Submitted by stetim94
over 8 years

Answer 55ee96109113cbfe6900049a

0 votes

Permalink

Thanks Stetim94! :)

points
Submitted by fferna07
over 8 years

1 comments

stetim94 over 8 years

you’re welcome