Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $YECBGYFECGEAFWHA as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2

Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $BBWFDDBHHYHDXXAB as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2
HTML+CSS实现好看的三角形提示框样式_创想鸟

HTML+CSS实现好看的三角形提示框样式

在浏览网站时,大家有没有发现网站中有各式各样新颖的提示框,那你知道这些好看的提示框怎么制作的吗?这篇文章就和大家分享一个css实现的好看的三角形提示框,有一定的参考价值,感兴趣的朋友可以参考一下。

想要用CSS实现三角形提示框样式需要用到很多CSS中的属性,比如:display属性,border-radius圆角,position定位等等,如有不清楚的小伙伴可以看看我以前的文章,之前都有介绍过,或者访问 CSS视频教程 。

实例描述:给一个div,用border-radius,before,border-top等属性,在提示框的左上角和右下角加三角形,制作一个三角形提示框,具体代码如下:

HTML部分:

这是内容这是内容这是内容这是内容这是内容这是内容

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

CSS部分:

*{      margin: 0;      padding: 0;     }       .main{      width: 120px;      display: inline-block;      font-size: 14px;      color: #333;      line-height: 28px;      background: #F0981C;      position: relative;      padding: 10px;      -webkit-border-radius:5px;      -moz-border-radius:5px;      : 5px;     }     /*左三角*/     .main:before{      content: ' ';      border-top: 8px solid transparent;      border-bottom: 8px solid transparent;      border-right: 12px solid #F0981C;      position: absolute;      top: 15px;      left: -12px;     }     /*右三角*/     .main:after{      content: ' ';      border-top: 8px solid transparent;      border-bottom: 8px solid transparent;      border-left: 12px solid #F0981C;      position: absolute;      bottom: 15px;      right: -12px;     }

效果图:

aa.jpg

以上分享了用CSS制作三角形提示框的代码,喜欢的小伙伴可以拿去使用,也可以修改成自己喜欢的样式,希望这篇文章对你有所帮助!

【相关教程推荐】

1. HTML视频教程
2. CSS3视频教程
3. bootstrap教程

以上就是HTML+CSS实现好看的三角形提示框样式的详细内容,更多请关注创想鸟其它相关文章!

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

赞 (0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
Bootstrap是什么意思?Bootstrap怎么用?
上一篇 2025年12月24日 03:04:44
css中clip-path属性的用法讲解(附代码)
下一篇 2025年12月24日 03:04:59

相关推荐

发表回复

登录后才能评论
关注微信