473,382 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Minimum width for <input> etc?

How can i set in my css a min width for input elements, but leave the max
size dynamic?

Ben
Jul 20 '05 #1
3 12157
In article <3f***********************@freenews.iinet.net.au >, iinet
wrote:
How can i set in my css a min width for input elements, but leave the max
size dynamic?


for example:

input {min-width:40em;}

Won't work on IE. I don't think there is any way to make it work in IE.

I don't think this is best possible answer to your question, URL would
help.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Feel free to contact me by email if your message OT, or private, etc.
but do not CC same message to as you send to usenet.
Jul 20 '05 #2
Lauri Raittila <la***@raittila.cjb.net> writes:
In article <3f***********************@freenews.iinet.net.au >, iinet
How can i set in my css a min width for input elements, but leave the max
size dynamic?


for example:

input {min-width:40em;}

Won't work on IE. I don't think there is any way to make it work in IE.

I don't think this is best possible answer to your question, URL would
help.


According to the specification, min-width doesn't apply to
non-replaced inline elements such as <input>, so you'd also need to do
a display: block; or similar.

And browsers tend to accept a lot less styling on form input elements
than they do on others, so I'm not sure if this is reliably possible
at all.

Pity, because it could be quite useful for a user stylesheet. As
regards author stylesheet it seems better to set the width
appropriately through the HTML.

--
Chris
Jul 20 '05 #3
Chris Morris <c.********@durham.ac.uk> wrote:
According to the specification, min-width doesn't apply to
non-replaced inline elements such as <input>, so you'd also need to
do a display: block; or similar.
The concepts of "replaced" or "non-replaced" element are confusingly
and vaguely defined, but the CSS2 specification explicitly mentions
INPUT as _replaced_ element. Well, in its vague style:
"In HTML, IMG, INPUT, TEXTAREA, SELECT, and OBJECT elements can be
examples of replaced elements."
http://www.w3.org/TR/REC-CSS2/confor...placed-element
And browsers tend to accept a lot less styling on form input
elements than they do on others,
Indeed, but the situation is improving.
so I'm not sure if this is reliably possible at all.
Surely not reliably - CSS is unreliable _by design_ (in the sense that
a style sheet might not be applied, or might be applied in conjunction
with other style sheets that override it, in part or entirely).
Pity, because it could be quite useful for a user stylesheet.


Seems to work on Opera, for example. But there are other potential
problems with input fields that might more serious. Authors often set
font size in input fields to something very small, for example.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jonathan Daggar | last post by:
Hello, I'm trying to put together a form with a very tight table formatting. However, every time I put an text-type input field in, the browser pads the area to the right of it with space. I've...
2
by: not 2 swift | last post by:
I thought I would update an old page on which I had used a <INPUT TYPE=image ...> with a <BUTTON><IMG SRC=...></BUTTON> The problem is that <BUTTON> always provides a shadow/emboss effect. Can...
3
by: TR | last post by:
Is it possible with CSS to prevent this wrapping alignment with a checkbox with a nested label? This is the label of the checkbox that wraps beneath it I'd prefer it looked like...
3
by: Ben | last post by:
Here's my form: <form name="aForm" method='post'> <input type=file name=file1 onkeypress='KeyPress()'><br> <a id='attachMoreLink' href='javascript:AddFileInput()">Attach More Files </a> <input...
2
by: Richard Maher | last post by:
Hi, I'm trying to use the Visibility Style attribute for a Div to effectively PopUp a lightweight window with some additional context-sensitive information, when a user mouses over a given...
2
by: Sreenath Rao Nellutla | last post by:
Hai all, I am trying to create dropdown calendar control with HTML input control by writing JavaScript. But while executing I am getting the error as "Error on Page" on the status bar of the...
1
by: JPhilS | last post by:
Hi to all Webmaster! I have discover this problem when I inserted the scores of the students i a centain subject. I am making a school project with regards to saving students' record. first, I...
1
by: test9991014 | last post by:
Hi folks, I've got something like this: <table> <tr> <td>1</td> <td align=center> <input type=text> </td>
7
by: Jordan Boden | last post by:
Hi. I'm trying to use a link in a echo statement. The code below is currently in a if statement so that if a seat is free then a button is displayed to allow the user to proceed to pay for the seat....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.