有时候在网页设计中会涉及到很多看上去很繁琐的设计图,这时候都会很让人头疼,那么这时候伪类就可以来帮助你解决问题了。

下面有一段实例大家可以参考一下;

 <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<style type="text/css">
.box{
width: 800px;
height: 800px;
margin: 0 auto;
}
p{
line-height: 1.5;
}
*{
margin: 0;padding: 0;
}
.clearfix{
clear: both;
}
.left,.content,.right{
width: 200px;float: left;position:relative;
}
.content{
margin:80px 50px;
}
.left::after{
content:"";width:1px;height: 160px;position:absolute;top:50px;right:0px;background:deeppink;
}
.right::before{
content:"";width:1px;height: 160px;position:absolute;top:50px;left:-50px;background:deeppink;
}
.left-one,.content-one,.right-one{
width: 150px;height: 60px;border: 1px solid #0000C6;margin: 20px 0;position:relative;
} .left-one::after{
content:"";width:50px;height: 1px;position:absolute;top:30px;right:-50px;background:deeppink;
} .content-one::before{
content:"";width:50px;height: 1px;position:absolute;top:30px;left:-50px;background:deeppink;
}
.content-one::after{
content:"";width:50px;height: 1px;position:absolute;top:30px;right:-50px;background:deeppink;
} .right-one::before{
content:"";width:50px;height: 1px;position:absolute;top:30px;left:-50px;background:deeppink;
} </style>
<body>
<div class="box">
<div class="left">
<div class="left-one">
<p>大风来袭不再怕</p>
<p>大风来袭不再怕</p>
</div>
<div class="left-one">
<p>大风来袭不再怕</p>
<p>大风来袭不再怕</p>
</div>
<div class="left-one">
<p>大风来袭不再怕</p>
<p>大风来袭不再怕</p>
</div>
</div>
<div class="content">
<div class="content-one">
<p>大风来袭不再怕</p>
<p>大风来袭不再怕</p>
</div>
</div>
<div class="right">
<div class="right-one">
<p>大风来袭不再怕</p>
<p>大风来袭不再怕</p>
</div>
<div class="right-one">
<p>大风来袭不再怕</p>
<p>大风来袭不再怕</p>
</div>
<div class="right-one">
<p>大风来袭不再怕</p>
<p>大风来袭不再怕</p>
</div>
</div>
<div class="clearfix"></div>
</div>
</body>
</html>

效果如下图所示:

途中所有的关系线全部都是有伪类写的,大家如果有什么不懂得随时可以评论下方,请赐教。

最新文章

  1. mac命令行常用
  2. 在ASP.NET中如何运行后台任务
  3. Linux系统目录分析
  4. C++ 我想这样用(一)
  5. [1] Spring.Net
  6. 关于移动端自动化测试-Appium的搭建
  7. 被低估的.net(上) - 微软MonkeyFest 2018广州分享会活动回顾
  8. 在mmdetection中跑通MaskRCNN
  9. .NetCore外国一些高质量博客分享
  10. SQL中触发器的使用
  11. ssh 免密root登录
  12. better-scroll插件
  13. curl解压gzip页面gzcompress内容
  14. 写个OAuth2.0的请求端来测试自己的OAuth2.0服务端(二)
  15. pgm9
  16. (原创)用c++11打造类似于python的range
  17. testng入门教程6 TestNG忽略测试
  18. ML(1): 入门理论
  19. 更改虚拟内存(使用于win7、win8系统)
  20. Linux内核(5) - 内核学习的相关资源

热门文章

  1. ios swift4之kvo的使用
  2. SAP 740GUI客户端快捷方式取消密码登陆
  3. CF912D Fishes 期望
  4. idea配置maven和gradle,阿里云镜像私服
  5. H - 逆序数(树状数组)
  6. 编译安装libimobiledevice
  7. python3 发送邮件添加附件
  8. sublime快捷键:快速查找函数和快速匹配括号
  9. 前端面试题 ---- html篇
  10. python3 pip使用报错