I am implementing a search bar here. I have finished basic UI. I have been recently developed a taste for scalable and robust HTML/CSS. Therefore I am closely following things like BEM and OOCSS
Am I on the right path? Also, how can I make the UI responsive?
index.html
<div id="container">
<form class="search-box">
<span class="search-box-icons">
<i class="fa fa-search icon-search"></i>
</span>
<input class="search-box-input" type="text" placeholder="Search"/>
<div class="search-box-autocomplete" style="display: none;">
Foo Bar
</div>
</form>
</div>
app.css
* {
margin: 0;
box-sizing: border-box;
font-family: 'Roboto', sans-serif;
}
body {
background: #343d46;
}
#container {
width: 500px;
margin: auto;
margin-top: 30px;
background: gray;
color: black;
}
.search-box {
width: 100%;
position: relative;
background: inherit;
color: inherit;
height: auto;
}
.search-box:hover .icon-search {
opacity: 1;
}
.search-box-input {
background: inherit;
color: inherit;
height: 50px;
font-size: 18px;
width: 100%;
padding: 10px;
padding-left: 40px;
display: inline-block;
border: none;
}
.search-box-input:focus {
outline: none;
}
.search-box-icons {
position: absolute;
display: inline-block;
margin: auto;
top: 16px;
left: 10px;
width: auto;
}
.icon-search {
color: inherit;
font-size: 16px;
display: inline;
cursor: pointer;
opacity: 0.4;
}
.search-box-autocomplete {
position: absolute;
background: #fff;
width: 100%;
margin: 0;
border-top: 1px solid gray;
}