CSS的小三角_html/css_WEB-ITnose

上三角▲

1 width: 0;2 height: 0;3 line-height: 0;4 font-size: 0;5 border-width: 10px;6 border-style: solid;7 border-color: transparent transparent #000 transparent;

登录后复制

 

下三角?

1 width: 0;2 height: 0;3 line-height: 0;4 font-size: 0;5 border-width: 10px;6 border-style: solid;7 border-color: #000 transparent transparent transparent;

登录后复制

左三角

1 width: 0;2 height: 0;3 line-height: 0;4 font-size: 0;5 border-width: 10px;6 border-style: dashed solid dashed dashed;7 border-color: transparent #000 transparent transparent;

登录后复制

右三角

立即学习“前端免费学习笔记(深入)”;

1 width: 0;2 height: 0;3 line-height: 0;4 font-size: 0;5 border-width: 10px;6 border-style: dashed dashed dashed solid;7 border-color: transparent transparent transparent #000 ;

登录后复制

三角若需要定位自己添加position

三角的大小更改border-width,颜色更改border-color中的颜色值。

 

 已在IE6/7/8和火狐中测试没有兼容问题,需要注意的是在IE6中不支持border-color里的transparent透明属性,即三角周围会显示成白色,解决方法有两种:

一、如果三角的背景是单色,把border-color里的transparent改成对应的颜色值

二、如果三角的背景不是单色,需要IE6里的CSS改成支持透明,网上有很多种方法,个人支持使用JS??DD_belatedPNG,以后会在博文中介绍的。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。

发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/3088377.html

(0)
上一篇 2025年3月28日 08:58:43
下一篇 2025年3月28日 08:58:51

AD推荐 黄金广告位招租... 更多推荐

发表回复

登录后才能评论