I am trying to show the border color when hovering over a list of elements. When I move the mouse over the elements of the first line, the elements of the second line move to the right. Please check jsFiddle
<ul class="tiles"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> </ul>
CSS
ul.tiles { width: 400px; } ul.tiles li { float: left; list-style-type: none; width: 100px; height: 100px; margin: 10px; background: white; } ul.tiles li:hover { border: 1px solid black; } }
source share