css制作小三角
视觉稿中经常有些小三角,如下图。每次用图片做太不方便了,我们看看用css实现的效果(支持ie6,7哦)
- <style>
- /*border实现三角*/
- /*箭头向上*/
- .arrow-top{
- width : 0;
- height : 0;
- font-size : 0;
- line-height : 0;
- border-left: 5px dashed transparent;
- border-right: 5px dashed transparent;
- border-bottom: 5px solid red;
- }
- /*箭头向下*/
- .arrow-bottom{
- width : 0;
- height : 0;
- font-size : 0;
- line-height : 0;
- border-left: 5px dashed transparent;
- border-right: 5px dashed transparent;
- border-top: 5px solid red;
- }
- /*箭头向右*/
- .arrow-right{
- width : 0;
- height : 0;
- font-size : 0;
- line-height : 0;
- border-bottom: 5px dashed transparent;
- border-top: 5px dashed transparent;
- border-left: 5px solid red;
- }
- /*箭头向左*/
- .arrow-left{
- width : 0;
- height : 0;
- font-size : 0;
- line-height : 0;
- border-bottom: 5px dashed transparent;
- border-top: 5px dashed transparent;
- border-right: 5px solid red;
- }
- </style>
来看看整体html
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>border实现三角</title>
- <style>
- /*border实现三角*/
- /*箭头向上*/
- .arrow-top{
- width : 0;
- height : 0;
- font-size : 0;
- line-height : 0;
- border-left: 5px dashed transparent;
- border-right: 5px dashed transparent;
- border-bottom: 5px solid red;
- }
- /*箭头向下*/
- .arrow-bottom{
- width : 0;
- height : 0;
- font-size : 0;
- line-height : 0;
- border-left: 5px dashed transparent;
- border-right: 5px dashed transparent;
- border-top: 5px solid red;
- }
- /*箭头向右*/
- .arrow-right{
- width : 0;
- height : 0;
- font-size : 0;
- line-height : 0;
- border-bottom: 5px dashed transparent;
- border-top: 5px dashed transparent;
- border-left: 5px solid red;
- }
- /*箭头向左*/
- .arrow-left{
- width : 0;
- height : 0;
- font-size : 0;
- line-height : 0;
- border-bottom: 5px dashed transparent;
- border-top: 5px dashed transparent;
- border-right: 5px solid red;
- }
- </style>
- </head>
- <body>
- <div>
- <span>店铺信息</span>
- <span class="arrow-right" style="display: inline-block;"></span>
- <span class="arrow-left" style="display: inline-block;"></span>
- <span class="arrow-top" style="display: inline-block;"></span>
- <span class="arrow-bottom" style="display: inline-block;"></span>
- </div>
- </body>
- </html>
css制作小三角的更多相关文章
- 用CSS制作小三角提示符号
今天在项目中遇到了如下图的切图要求. 对,重点就是那个小三角提示符号. html 结构如下 <div class="wrap"> <div class=" ...
- 纯css制作小三角
在网站制作的过程中常涉及一些小图标,以前大部分会采用小图片.但有了css3后很多变得方便了,比如要在li列表的每行文字的前面加个小三角,可以这么写: <!DOCTYPE html> < ...
- CSS制作小旗子与小箭头
CSS制作小旗子与小箭头 效果图如下: 小旗子效果图 小箭头效果图 小旗子效果 以下是具体实现代码: <div class="container"> <div c ...
- css border制作小三角形状及气泡框(兼容IE6)
先看下CSS盒模型 一个盒子包括: margin+border+padding+content 上下左右边框交界处出呈现平滑的斜线. 利用这个特点, 通过设置不同的上下左右边框宽度或者颜色可以得到小三 ...
- CSS的小三角
上三角▲ width: 0; height: 0; line-height: 0; font-size: 0; border-width: 10px; border-style: solid; bor ...
- css实现小三角(原理)
效果图如图1所示:(简单示范,有点丑,莫介意) PS:兼容IE,FF , chrome ,360安全浏览器 先讲下原理吧,如图2所示: 这个div的样式如下所示: div{ width: 0px; h ...
- CSS实现小三角小技巧
<style> .box{ width: 20px; height: 20px; background-color: #424; border: 10px solid #9C27B0; b ...
- css制作倒三角
布局div,并命名为id="dropdown",在style使用border属性对div进行控制 #dropdown{ width:0px; height:0px; border- ...
- CSS生成小三角
前言:小三角的应用场景:鼠标移动到某个按钮上面,查看信息详情时,信息详情弹出框有时候会需要一个小三角. 代码如下: <div id='triangle'></div> #tri ...
随机推荐
- hadoop2.2编程:从default mapreduce program 来理解mapreduce
下面写一个default mapreduce 的程序: import org.apache.hadoop.mapreduce.Mapper; import org.apache.hadoop.mapr ...
- hadoop的wordcount例子运行
可以通过一个简单的例子来说明MapReduce到底是什么: 我们要统计一个大文件中的各个单词出现的次数.由于文件太大.我们把这个文件切分成如果小文件,然后安排多个人去统计.这个过程就是”Map”.然后 ...
- 如何在 Windows 7 安裝 SharePoint Server 2010
转:http://support.microsoft.com/kb/2683572/zh-tw 關於作者: 本文由微軟最有價值專家 MVP 歐志信 提供.微軟十分感謝 MVP 主動地將他們的經驗與上百 ...
- 如何判断 Android 应用的 Apk 签名是否一致?
可以比对apk签名的fingerprint. 假定安装了JDK,如果想查HelloWorld.apk所使用的签名的fingerprint,可以这样做: 1. 查找apk里的rsa文件 (Windows ...
- redis 用setbit(bitmap)统计活跃用户
getspool.com的重要统计数据是实时计算的.Redis的bitmap让我们可以实时的进行类似的统计,并且极其节省空间.在模拟1亿2千8百万用户的模拟环境下,在一台MacBookPro上,典型的 ...
- MVVM Light中的Message
比喻:像漂流瓶一样发送一个Message,任何人有兴趣就可以拾起来. MVVM Light中的Message的使用分为三个步骤: 1.创建一个类,包含要传递的Message. 2.在ViewModel ...
- HDU 4799 LIKE vs CANDLE 树形dp
题意:有n个人,他们的关系,形成一棵有根树(0是树根,代表管理员),每个人有一个价值 现在有一条微博,每个人要么点赞,要么送一个蜡烛 初始一些人利用bug反转了某些人的操作(赞变蜡烛 或者 蜡烛变成赞 ...
- BILL.WEI]stimulsoft reports 中panel 妙用
我们在通过stimulsoft reports做报表,有的时候,我们需要通过合并报表的一些中间列元素,我们就可以用到panel组件 如下图,我们需要合并报表中间项,一般手段达不到要求,只能通过嵌套pa ...
- 执行sql update use c#
今天犯了个大错 public static void ChangeGoodsCounts(int GoodsID, int changCounts) { int lastCount; using (S ...
- Maven之debug技巧
mvn eclipse:clean eclipse:eclipse -Dwtpversion=2.0 可以将项目编译为web项目,然后再项目上右键debug as server即可.