You have several mistakes at once.
First, you did not clear the stream after the float elements. To clear the stream, apply the following styles:
#navigation { overflow: hidden; }
Or:
#navigation:after { content: ''; display: block; clear: both; }
Secondly, the links need to put down the display: inline-block; property display: inline-block; so that they have height and can expand the parent unit:
a { display: inline-block; }
Full example:
.list-menu a:link, a:visited { background-color: #f44336; color: white; padding: 10px 25px; text-align: center; text-decoration: none; display: inline-block; } .list-menu a:hover, a:active { background-color: red; } #navigation { clear:both; padding-top:10px; border-bottom: 1px solid maroon; background-color:#F0F0F0; } #navigation:after { content: ''; display: block; clear: both; } .list-menu { width:90%; float:left; display:inline-block; } .search { width:10%; float:left; }
<div id="navigation"> <div class="list-menu"> <a href="#">О нас</a> <a href="#">Регистрация</a> </div> <div class="search"> <form action="search.php"> <input type="text" name="search" placeholder="Поиск"> </form> </div> </div>