I have a total of 7 divs, with one designated for the middle position.
The goal is to display the top two pictures and the knife aligned correctly, but the rest are not appearing as desired.
Below is the CSS code:
.vegetablewrapper {
width: 100%;
overflow: hidden;
background-color: white;
}
.vegetableleft {
float: left;
width: 350px;
padding: 5px;
margin-left: 5px
}
.vegetableright {
float: right;
width: 345px;
padding: 5px;
margin-right: 8px;
}
.vegetablemiddle {
float: left;
width: 200px;
padding: 5px;
}
And here is the HTML code:
<div class="vegetableleft">
<img src="bilder/leek.jpg" alt="leek"/>
</div>
<div class="vegetablemiddle">
<img src="bilder/knife.jpg" alt="knife"/>
</div>
<div class="vegetableright">
<img src="bilder/leekcut.jpg" alt="leek cut"/>
</div>
<div class="vegetableleft">
<img src="bilder/onion.jpg" alt="onion"/>
</div>
<div class="vegetableright">
<img src="bilder/onioncut.jpg" alt="onion cut"/>
</div>
<div class="vegetableleft">
<img src="bilder/carrot.jpg" alt="carrot"/>
</div>
<div class="vegetableright">
<img src="bilder/carrotcut.jpg" alt="carrot cut"/>
</div>
</div>
When using this code, my webpage appears like this:
Any suggestions on how to achieve the correct layout?