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
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

Edited by ChadGregory
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.