Jump to content

HTML input text size


sseeley

Recommended Posts

Hello I have a text field

 

echo "<input type = \"text\" name = \"mobileTel\" id = \"mobileTel\" size = \"10\" maxlength = \"10\" value = \"$mobileTel\">";

 

I want to get the height of the input box smaller than the default.

 

Can anyone help me with the code?

 

Many thanks in advance.

 

Stuart

Link to comment
Share on other sites

on a sidenote, you may want to use single quotes instead of escaping every double quote for easier to read code/less typing.

For example:

echo "<input type='text' name='mobileTel' id='mobileTel' size='10' maxlength='10' value='$mobileTel'>";

or reverse the quotes and use

echo '<input type="text" name="mobileTel" id="mobileTel" size="10" maxlength="10" value="$mobileTel">';

 

If you want all inputs on the page to be displayed like that you may want to use this inside the <head> section.

<style type="text/css">
  input[type=text]{ height: 15px; } /*do note that attribute selectors do not work in IE6 */
</style>

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.