I'm in the process of creating a responsive blog with a search input feature. However, I've encountered an issue where the search form input in my sidebar isn't collapsing properly and is overflowing outside of its designated container. Below is the code snippet that I've been working on so far. Can anyone provide assistance or suggestions on how to make this layout more responsive?
<div class="gridContainer clearfix">
<!--HEADER-->
<div id="LayoutDiv1">
<div align="center">
<!--NAVIGAIION + LOGO-->
</div>
<nav>
<div class="header">
<div id="toplogo top" align="center"><a class="logo" href="#"></a> </div>
<hr>
<div align="center">
<!--navigation list items-->
<ul id="topmargin" class="navigation scaling">
<li class="scaling"><a href="#"></a><img class= "invert" src="home.png" width="160px" height="55px"></li>
<li class="scaling"><a href="#"></a><img class="invert" src="about.png"></li>
<li class="scaling"><a href="#"></a><img class="invert" src="contact.png"></li>
<li class="scaling"><a href="#"></a><img class="invert" src="work.png"></li>
</ul>
<hr>
</div>
</div>
</nav>
<div align="center">
<!--end of NAVIGATION + LOGO-->
</div>
<div id="LayoutDiv2" class="clearfix">
<div id="content"> <p>This is the Content efnoifnegnrorfnoewnfdksncldncksdjcndlscnkdsncldksnclnsdl
</p>
</div>
<aside>
<div id="sidebar">
<div id="sidebar-content">
<p> This is the Sidebar</p>
<form class=action="" id="search-form" method="get">
<input type="text" value="search" onblur="if(this.value=='')this.value='search'" onfocus="if(this.value=='search')this.value=''"/>
<input type="hidden" value="submit"/>
</form>
</div>
</div>
</aside>
</div><!--end of LayoutDiv2-->
<div id="LayoutDiv3">
<hr>
<footer><!--beginning of FOOTER-->
<div class="footer">
<p>PETER</p>
</div>
</footer> <!-- end of FOOTER-->
</div>
</div><!--end of LayoutDiv1-->
</div>
<p> </p>
<!--end of Grid Container, HEADER, CONTENT, FOOTER-->
And here is my CSS:
img, object, embed, video {
max-width: 100%;
}
.ie6 img {
width:100%;
}
#topmargin{
margin-top: 5px;
margin-bottom: 5px;
}
form{
padding:5px;
word-wrap:break-word;
}
.logo{
background: url(PLUM%20monogram1.png);
display: block;
height: 100px;
margin-bottom: 10px;
margin-left: auto;
margin-right: auto;
text-align: center;
transition: all 500ms linear 0s;
width: 56px;
z-index: 2;
margin-top:5px;
}
.logo:hover{
background-image: url(PLUM%20monogram2.png);
transition: all 300ms linear 0s;
margin-top:5px;
}
#toplogo{
display:inline-block;
margin-top:10px;
height:100px;
}
.navigation{
clear: both;
margin-left: auto;
margin-right: auto;
/* [disabled]list-style: none; */
padding: 0px;
-webkit-flex-flow: row wrap;
justify-content: center;
font-size: 1.4em;
letter-spacing: 1px;
overflow: hidden;
padding-bottom: 10px;
text-align: center;
width: 100%;
display:inline;
}
li{
display: inline;
list-style-type: none;
}
.scaling{
min-width:25%;
display:inline block;
}
.invert{
}
.invert:hover{
-webkit-filter: invert(100%);
transition: all 100ms linear 0s;
}
/* Mobile Layout: 480px and below. */
.gridContainer {
margin-left: auto;
margin-right: auto;
width: 87.36%;
padding-left: 1.82%;
padding-right: 1.82%;
word-wrap:break-word;
}
#LayoutDiv1 {
clear: both;
float: left;
margin-left: 0;
width: 100%;
display: block;
}
#LayoutDiv2 {
clear: both;
float: left;
margin-left: 0;
width: 100%;
display: block;
}
p{
padding:5px;
}
body, html {
height: 100%;
padding:1px;
}
#content{
display:inline-block;
float:left;
width:80%;
background:#F36;
height:100%;
}
#sidebar{
display: inline-block;
background:#0FC;
float: left;
width: 20%;
word-wrap:break-word;
}
#sidebar-content{
padding:5px;
overflow:hidden;
word-wrap:break-word;
}
.search-input{
width:70%;
}
.footer{
background:#00F;
}
#LayoutDiv3{
clear: both;
float: left;
margin-left: 0;
width: 100%;
display: block;
}
@media (max-width: 480px) {
gridContainer {
width: 90.675%;
padding-left: 1.1625%;
padding-right: 1.1625%;
word-wrap:break-word;
}
#LayoutDiv1 {
clear: both;
float: left;
margin-left: 0;
width: 100%;
display: block;
}
#LayoutDiv2 {
clear: both;
float: left;
margin-left: 0;
width: 100%;
display: block;
}
#LayoutDiv3{ clear: both; float: left; margin-left: 0; width: 100%; display: block; }
#sidebar{ clear: both; width: 100%; }
#content{ clear: both; width: 100%; }
}
/* Tablet Layout: 481px to 768px. Inherits styles from: Mobile Layout. */
@media only screen and (min-width: 481px) {
.gridContainer {
width: 90.675%;
padding-left: 1.1625%;
padding-right: 1.1625%;
word-wrap:break-word;
}
#LayoutDiv1 {
clear: both;
float: left;
margin-left: 0;
width: 100%;
display: block;
}
#LayoutDiv2 {
clear: both;
float: left;
margin-left: 0;
width: 100%;
display: block;
}
#LayoutDiv3 {
clear: both;
float: left;
margin-left: 0;
width: 100%;
display: block;
}
/* Desktop Layout: 769px to a max of 1232px. Inherits styles from: Mobile Layout and Tablet Layout. */
@media only screen and (min-width: 769px) {
.gridContainer {
width: 88.2%;
max-width: 1232px;
padding-left: 0.9%;
padding-right: 0.9%;
margin: auto;
}
#LayoutDiv1 {
clear: both;
float: left;
margin-left: 0;
width: 100%;
display: block;
}
#LayoutDiv2 {
clear: both;
float: left;
margin-left: 0;
width: 100%;
display: block;
}
#LayoutDiv3 {
clear: both;
float: left;
margin-left: 0;
width: 100%;
display: block;
}
}
If anyone has any tips or guidance on improving the responsiveness of this blog layout, your help would be greatly valued.