CSS 中的响应式输入字段 - 流体宽度?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11361075/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Responsive input fields in CSS - fluid width?
提问by michaelmcgurk
I'm trying to make the following sign up box fluid responsive in CSS.
我正在尝试使以下注册框在 CSS 中具有响应性。
Here is an example: http://cssdesk.com/aYLwW
这是一个例子:http: //cssdesk.com/aYLwW
I would like the input field width to be "flexible" and shrink depending on the page.
我希望输入字段宽度“灵活”并根据页面缩小。
You can see from the example when I shrink the window, the button eventually drops down below the input field.
您可以从示例中看到,当我缩小窗口时,按钮最终会下降到输入字段下方。
With this in mind, what should I set my input#iiihuu-iiihuu field width to beto allow the input field to gracefully resize without any bumpage?
考虑到这一点,我应该如何将 input#iiihuu-iiihuu 字段宽度设置为允许输入字段优雅地调整大小而没有任何颠簸?
Many thanks for any pointers :-D
非常感谢您的指点:-D
回答by Ashwin Singh
Give a min-width:550px;
to the div containing the text-box and button. Your control will not break then.
给min-width:550px;
包含文本框和按钮的 div 赋值。那时你的控制不会中断。
Working ex. here http://cssdesk.com/dUjxF
工作前。这里http://cssdesk.com/dUjxF
As the definition says min-width sets a min-width to the element, it doesn't go below that size under any circumstances.
正如定义所说的 min-width 为元素设置了一个 min-width ,它在任何情况下都不会低于该大小。