开发者

css to set width but not exceed table 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜