首页
CSS
CSS 溢出
尝试:使用 overflow: scroll
运行 ❯
获取您
自己
的网站
×
更改方向
保存代码
更改主题,深色/浅色
转到 Spaces
<!DOCTYPE html> <html> <head> <style> div { background-color: coral; width: 200px; height: 100px; border: 1px solid black; overflow: scroll; } </style> </head> <body> <h2>Overflow: scroll</h2> <p>Setting the overflow value to scroll, the overflow is clipped and a scrollbar is added to scroll inside the box. Note that this will add a scrollbar both horizontally and vertically (even if you do not need it):</p> <div>You can use the overflow property when you want to have better control of the layout. The overflow property specifies what happens if content overflows an element's box.</div> </body> </html>