主页
CSS
CSS 高度/宽度
试用:使用 max-width 和 min-width
运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> div { max-width: 400px; min-width: 100px; background-color: powderblue; } </style> </head> <body> <h2>Set the max-width and min-width of an element</h2> <p>Resize the browser window to see the effect.</p> <div>This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.</div> </body> </html>