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)
精彩评论