CSS3 border凹陷该如何编写?
问题描述
本人新手,请问各位大神,如此,该如何编写CSS3 ? (我说的是蓝色的部分) 谢谢了~~
问题解答
回答1:我的思路:绝对定位+after/before伪类实现,大致实现的效果如下:
TZ可以参见给的demo自行修改一下:在线demo
回答2:如果换个思路的话,可以把那个圆的margin设置成背景色,然后盖住右侧,这样看上去就像是凹进去的效果了。
回答3:首先更正一下一楼的答案,after/before是伪元素而不是伪类,这个很重要,不能把这个弄混淆了,如果是我我会用一个大圆覆盖长条,再用小圆覆盖大圆就好了
回答4:<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'><head> <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'> <title>css</title></head><body><style>#a { width: 150px; height: 300px; background: radial-gradient(circle at top left, transparent 15px, #e6e4b7 0) top left, radial-gradient(circle at top right, transparent 15px, #e6e4b7 0) top right, radial-gradient(circle at bottom right, transparent 15px, #e6e4b7 0) bottom right, radial-gradient(circle at bottom left, transparent 15px, #e6e4b7 0) bottom left; background-size: 50% 50%; background-repeat: no-repeat; padding: 20px 24px 22px 20px;}#b { display: block; background: radial-gradient(circle at top left, transparent 15px, red 0) top left, radial-gradient(circle at top right, transparent 15px, red 0) top right, radial-gradient(circle at bottom right, transparent 15px, red 0) bottom right, radial-gradient(circle at bottom left, transparent 15px, red 0) bottom left; background-size: 50% 50%; background-repeat: no-repeat; width:100%; height: 100%; padding: 2px;}#b:before { content: ''; width: 100%; height: 100%; display: block; background: radial-gradient(circle at top left, transparent 15px, #e6e4b7 0) top left, radial-gradient(circle at top right, transparent 15px, #e6e4b7 0) top right, radial-gradient(circle at bottom right, transparent 15px, #e6e4b7 0) bottom right, radial-gradient(circle at bottom left, transparent 15px, #e6e4b7 0) bottom left; background-size: 50% 50%; background-repeat: no-repeat;}</style> <p id='a'><p id='b'></p> </p></body></html>
相关文章:
1. 修改mysql配置文件的默认字符集重启后依然不生效2. java - mybatis源码分析3. python相关问题求解决,有偿4. android - 安卓activity无法填充屏幕5. java - ehcache缓存用的是虚拟机内存么?6. java - MongoDB关闭连接7. css - 移动端h5播放器问题求解决,急急8. angular.js - 用angularjs的service封装百度地图api出错,请问原因?9. mysql - 我用SQL语句 更新 行的时候,发现全部 中文都被清空了,请问怎么解决?10. mysql - 数据库:获取两个字段与获取*,传输的数据量差距大吗?

网公网安备