Jump to content

Textbox Giving Me Trouble


ChadGregory

Recommended Posts

I am creating a responsive website and I am coming across a strange problem with my search text box. I want the text box to span the full width parent element. Here are the css rules applied to the text box.

 

#searchform input[type = text] {
 border: 0;
 padding: 8px 0;
 width: 100%;
 max-width: 640px;
 top: 0;
 margin:0;
position: relative;
}

 

I have the view port setup correctly and every else works fine, but there is white space on the right side of the text box. After tinkering with the css properties in Chrome to get live updates using Chrome Developer Tools I stumbled across a very strange partial solution. If i disable the width: 100%; property and re-enable it the white space disappears. I reload the page and its back again.

 

How can I fix this issue?

Link to comment
https://forums.phpfreaks.com/topic/272281-textbox-giving-me-trouble/
Share on other sites

<form role="search" method="get" id="searchform" action="http://papillonstudios.ca">
<div> <input type="text" value="" placeholder="Search..." name="s" id="s">
<input type="submit" id="searchsubmit" value="" width="26" height="28">
</div>
</form>

 

Live Link(WIndow Width must be 640px or less) - http://papillonstudios.ca

Just so I'm clear, is the problem with the text box not aligning correctly with your submit button?

 

If that is an issue, then change your top: 8px to top: 0px on your #searchform input[type=submit] element.

 

That's the only issues I'm seeing at the moment.

 

Regards,

 

AoTB.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.