Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialCarlo Sabogal
7,468 PointsCan I use max-width and min-width, max-height and min-height in the same property?
for example:
.box {min-height: 50px; max-height:50px; min-width: 50px; max-width: 50px;}
4 Answers
Shawn Denham
Python Development Techdegree Student 17,801 PointsYes you can..but why wouldn't you just use .box {width: 50px; height: 50px:} ?
Carlo Sabogal
7,468 Pointsyeah, sorry Shawn, i meant ...box {min-height: 50px; max-height:100px; min-width: 50px; max-width: 100px;}, would it work with percentages as well? thanks!
Shawn Denham
Python Development Techdegree Student 17,801 Pointsah gotcha!
Yes you absolutely can! In fact that is really what the standard was created for!
Also you can play and experiment with these kinds of things at codepen.io
akhil maddu
1,422 Pointsyes, you can use it.browser will overwrite these properties.first it will use max-width prperty and then min-width.