I'm having trouble adjusting the width of my search input to 100% on screen resize (using @media (max-width: 1200px)). The issue:
https://i.sstatic.net/EMr6W.jpg
Here's how it should look (I can achieve this with a specific pixel width, but not dynamically):
https://i.sstatic.net/JrmVQ.png
index.html file:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>MONI BAU</title>
<link rel="icon" href="Fotot/icon.png">
<link href="Css/bootstrap.css" rel="stylesheet">
<link rel="stylesheet" href="Css/style.css">
</head>
<body>
<div class="container">
<nav class="navbar navbar-default">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#mainNavBar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="#" class="navbar-brand"><img src="Fotot/logo.png" width="200px"></a>
</div>
<div class="collapse navbar-collapse" id="mainNavBar">
<div class="paddingSearch navbar-right">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Kërko" name="q">
<div class="input-group-btn">
<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
</div>
<ul class="nav navbar-nav navbar-right paddingSearch">
<li><a href="#"><i class="glyphicon glyphicon-home"> </i>Kryefaqja</a></li>
<li><a href="#"><i class="glyphicon glyphicon-wrench"></i>Produktet</a></li>
<li><a href="#"><i class="glyphicon glyphicon-envelope"></i>Kontakt</a></li>
<li><a href="#"><i class="glyphicon glyphicon-user"></i>Për Ne</a></li>
</ul>
</div>
</nav>
</div>
<script src="http://code.jquery.com/jquery-1.12.0.min.js"></script>
<script type="text/javascript" src="JS/bootstrap.min.js"></script>
</body>
</html>
and my custom style.css:
body{
background-image: url(../Fotot/background.png);
margin: 0;
padding: 0;
font-family: Century Gothic,CenturyGothic,AppleGothic,sans-serif;
}
.navbar-brand {
height: 80px;
}
.paddingSearch
{
padding-top: 15px;
padding-bottom:15px;
margin: 0;
color: #1a0000;
font-size: 12pt;
}
.paddingSearch i{
color: black;
width: 20px;
}
.navbar-toggle {
padding: 10px;
margin: 25px 15px 25px 0;
}
.navbar-brand {
display: flex;
align-items: center;
}
@media (max-width: 1200px) {
.navbar-header {
float: none;
}
.navbar-left,.navbar-right {
float: none !important;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.navbar-fixed-top {
top: 0;
border-width: 0 0 1px;
}
.navbar-collapse.collapse {
display: none!important;
}
.navbar-nav {
float: none!important;
margin-top: 7.5px;
}
.navbar-nav>li {
float: none;
}
.navbar-nav>li>a {
padding-top: 10px;
padding-bottom: 10px;
}
.collapse.in{
display:block !important;
}
.navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
}