Learn how to a build a cloud-first strategyRegister Now


set height,width of input textbox

Posted on 2011-05-07
Medium Priority
Last Modified: 2012-05-11
set height,width of input textbox not textarea
Question by:rgb192
LVL 13

Expert Comment

ID: 35713080
Do you have any markup to give us? Maybe some parsed HTML? A lot of times an input textbox will have a class, which will affect the code that is given.

Accepted Solution

Vampireofdarkness earned 1000 total points
ID: 35713092
input { height:100px;width:500px;background-color:red; }

<input type='text'>

Open in new window

input { height:[x]px/em; width:[x]px/em; }

That will set for all inputs (password, text, etc...) created by <input type='...'>. You can do the same with textarea by:

textarea { height:[x]px/em; width:[x]px/em; }
LVL 18

Assisted Solution

Eternal_Student earned 1000 total points
ID: 35713137
Or you could give the input boxes that you want styling a class:

<input type="text" class="input" id="" value="" name="" />

Open in new window

And then style them as you need:

<input type="text" class="input" id="" value="" name="" />

Open in new window

It's actually probably a better idea to set a font size and some padding rather than a height.
.input { height:20px;width:600px; }

Open in new window

LVL 18

Expert Comment

ID: 35713140
Sorry about the repeated <input /> HTML it got embedded incorrectly!

Author Closing Comment

ID: 35722140

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Suggested Courses
Course of the Month21 days, 5 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question