开发者

css to set width but not exceed table width

开发者 https://www.devze.com 2023-03-14 21:14 出处:网络
I would like the width of an input to be 80% but then not stretch across the screen past 200 px for instance. Is this possib开发者_开发百科le?Sure, use width and max-width:

I would like the width of an input to be 80% but then not stretch across the screen past 200 px for instance. Is this possib开发者_开发百科le?


Sure, use width and max-width:

input {
    width: 80%;
    max-width: 200px
}

http://jsfiddle.net/FTRun/ (reduce the window width)

0

精彩评论

暂无评论...
验证码 换一张
取 消