473,403 Members | 2,359 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,403 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 12160
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....
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.