
我想要一个固定高度的fIEldset,并在其中有一个可滚动的div.一切都看起来很好,直到我把一个传说 – 当我这样做时,div从字段集的底部溢出.我也检查了firefox,它没有这样做(即完全按照我的预期).
其他人看到这个?这是Chrome的错误吗?有人知道这是否有黑客?
<!DOCTYPE HTML><HTML> <head> <Title>a</Title> <style> fIEldset { height: 80px; } fIEldset div { height: 100%; overflow-y: scroll; } </style> </head> <body> <fIEldset> <legend>Test</legend> <div> Foo!<br/> Foo!<br/> Foo!<br/> Foo!<br/> Foo!<br/> Foo!<br/> </div> </fIEldset> </body></HTML>解决方法 如果您不需要使用图例元素,另一种解决方案是适当地使用h1和样式.这适用于Chrome和FF. <!DOCTYPE HTML><HTML><head> <Title>a</Title> <style> fIEldset { height: 80px; } h1 { margin:0; margin-top:-1em; Font-size:1em; background:white; wIDth:33px; } fIEldset div { height: 100%; overflow-y: scroll; } </style></head><body> <fIEldset> <h1>Test</h1> <div> Foo!<br/> Foo!<br/> Foo!<br/> Foo!<br/> Foo!<br/> Foo!<br/> </div> </fIEldset></body> 总结 以上是内存溢出为你收集整理的HTML Fieldset内容溢出100%高度(Chrome)全部内容,希望文章能够帮你解决HTML Fieldset内容溢出100%高度(Chrome)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)