Search Box stops working when floated
-
I added a search box to my navigation bar using this code:
<div id="search-box"> <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/"> <div><input type="text" size="18" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" /> <input type="submit" id="searchsubmit" value="Search" class="btn" /> </div> </form> </div> <!-- #search-box -->
The box worked fine, until I changed the positioning of the “search-box” div with the following code ( .custom is for Thesis ):
.custom #search-box { float:right; }
After I added the CSS, the search box still displayed as expected but stopped working. I tested removing the float and adding a background color to the div, and the search box started working again (see below) so it appears the positioning is the issue:
.custom #search-box { background-color:red; }
I’m stumped and appreciate any help! I can’t include a link to the site because it is in development on my local machine.
- The topic ‘Search Box stops working when floated’ is closed to new replies.