Q
背景上的圆角?
0
A
回答
3
你必须给html
元素的背景颜色:
html, body {
height: 100%;
}
html { background: white }
body {
background-color:#7A991A;
border-radius: 20px;
}
这里的小提琴:http://jsfiddle.net/wYKa3/
-1
我不认为这是可能的。由于“body”是整个文档,因此如果您在页面的四个角上,应该在下面显示什么内容?
也许你可以将页面内容包装在一个<div>
元素中,该元素将具有全宽和全高,然后在其上设置圆角而不是主体。然后,将身体背景设置为与全尺寸div不同的颜色,然后设置。像这样的东西应该工作:
HTML:
<body>
<div id="content">
<!-- Your content here -->
</div>
</body>
CSS:
body { background-color: #000000; }
#content {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background-color: #ffffff;
border-radius: 10px;
}
1
您可以使用此:
body{
-moz-border-radius:4px;
-webkit-border-radius:4px;
border-radius: 4px;
-moz-box-shadow:0 2px 2px rgba(0,0,0,0.3);
-webkit-box-shadow:0 2px 2px rgba(0,0,0,0.3);
box-shadow: 0 2px 2px rgba(0,0,0,0.3);
background:#7A991A;
}
它与圆润shaddaw颜色的角落背景。
+0
0
您可能还需要使用-webkit-border-radius
和-moz-border-radius
,像这样:
body {
background-color:#7A991A;
border-radius: 20px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
}
增加与不同的浏览器的兼容性。
0
你可以看到这个CSS与浏览器兼容级别:
html, body {
height: 100%;
background: white
}
body {
-moz-border-radius:20px;
-webkit-border-radius:20px;
border-radius: 20px;
background:red;
}
相关问题
- 1. NSTextView圆角,绘制背景
- 2. 圆角与背景颜色
- 3. 圆角矩形背景editext与背景边框左上角的提示
- 4. CSS圆角表角落,渐变背景
- 5. 按钮角落圆角背景图片
- 6. 图像角落上的圆角边界渐变背景拉伸
- 7. 圆角视图的角落android,不圆背景
- 8. android:带有动态背景颜色的圆角背景的TextView
- 9. 与平铺背景形状的圆角
- 10. 添加背景圆角[CSS/Twitter的Bootstrap]
- 11. UIImageView圆角有白色背景
- 12. 圆角IE和背景图像
- 13. IE9圆角和透明背景问题
- 14. 背景三角形而不是圆JS
- 15. NSAttributedString背景颜色和圆角
- 16. 钻石形,圆角和背景图像
- 17. 背景图像圆形角落
- 18. 如何创建背景CSS div /圆角?
- 19. WPF圆角背景出血通过
- 20. WPF Datagrid圆角与透明背景
- 21. php imagick图像圆角黑色背景
- 22. TransparencyKey在圆角背景图像上留下像素
- 23. 输入元素上的圆形背景
- 24. 编号的圆形背景
- 25. UIImageView在圆形背景上,在UICollectionViewCell
- 26. 角上的圆
- 27. 带有圆角的背景图像的div中的透明div
- 28. Firefox中的圆角:边框和背景之间的空间
- 29. 背景上的平行对角线
- 30. 用css背景和圆角边界的Firefox溢出错误
非常感谢 – ppaul 2012-04-15 23:44:59