1

Example with last <li> out of place

I have one problem. So as you can see, last <li> element is out of <div> and I want that <li> element to go to the next column. Is that possible?

This is my code.

.widget-container {
  z-index:9999;
  position:absolute;
  left:17.5%;
  background:white;
  width:65%;
  max-height:310px;
  border:1px solid grey;
}

.widget-container ul{
  display:block;
  list-style:none;
  width:10%;
  float:left;
  height:auto;
  max-height:310px;
}

.widget-container img{
  float:right;
  border:5px solid white;
}

.widget-container a{
  text-decoration:none;
  color:grey;
  padding:5px;
}
<div id="bijela_tehnika" class="widget-container">
  <ul>
    <a href="#"><li>Hladnjaci i zamrzivaći</li></a>
    <a href="#"><li>Perilica rublja</li></a>
    <a href="#"><li>Perilica suđa</li></a>
    <a href="#"><li>Klima uređaji</li></a>
    <a href="#"><li>Pećnice</li></a>
    <a href="#"><li>Ploće za kuhanje</li></a>
    <a href="#"><li>Uređaji za grijanje</li></a>
    <a href="#"><li>Bojleri</li></a>
  </ul>
  <img src="bijela_tehnika.jpg" width="800px" height="300px" />
</div>
Woodrow Barlow
  • 6,567
  • 2
  • 33
  • 76
Ivan Gorky
  • 73
  • 1
  • 1
  • 8
  • @j08691 can you explain it – Ivan Gorky Aug 12 '15 at 14:51
  • That's correct but not very useful... It's invalid because the list items should wrap the anchors, not the other way round. Only list items can be direct children of both ordered and unordered lists. – evilunix Aug 12 '15 at 14:52
  • @IvanGorky - You have `` elements wrapping your `
  • ` elements, which makes the `` elements children of the `
      `. That's invalid HTML.
  • – j08691 Aug 12 '15 at 14:54
  • why do you have `display: none` on your `.widget-container`? – Woodrow Barlow Aug 12 '15 at 14:59
  • @WoodrowBarlow I didn't write all my code, I have Javascript too – Ivan Gorky Aug 12 '15 at 15:00