纯css 箭头,纯CSS实现小箭头的案例

小箭头我们许多的美工前端使用的是图片来实现了,如果我们不使用图片直接使用css要如何来实现呢,下面我们来看一篇关于纯CSS实现小箭头的方法吧,具体如下。

a_33166

我们大多数的小箭头都是用小图片来做的,这里分享一款用纯CSS写的小箭头,大家可以看看,以后会放出更多的CSS小箭头来供大家参考。

.pre-wrap {

width: 200px;

height: 120px;

margin: 50px auto 0;

border: 2px solid #F00;

border-radius: 4px;

position: relative;

}

.pre {

width: 80px;

height: 80px;

position: absolute;

top: 20px;

left: 40px;

}

.pre1 {

border-width: 40px;

border-color: transparent #F30 transparent transparent;

}

.pre2 {

border-width: 40px;

border-color: transparent #FFF transparent transparent;

position: relative;

top: -80px;

left: 15px;

}

.pre1, .pre2 {

/*****设置border-style:dashed;使ie6支持border透明*****/

border-style: dashed solid dashed dashed;

/*****设置容器宽高为0*****/

width: 0;

height: 0;

/*****去掉ie6下默认高度,设置以下属性*****/

line-height: 0;

font-size: 0;

overflow: hidden;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CSS(层叠样式表)并不直接支持绘制流程图,但可以通过使用CSS的布局和样式规则来实现类似的效果。以下是一些常用的方法: 1. 使用列表元素(ul、ol)来表示流程图的步骤,然后设置样式规则来控制它们的外观和布局。 2. 使用表格元素(table、tr、td)来表示流程图的步骤,并使用CSS样式规则来设置它们的外观和布局。 3. 使用CSS伪元素(::before、::after)来在元素前或后添加图标或箭头,以模拟流程图的连接线和图标效果。 下面是一个例子,展示如何使用CSS列表元素和伪元素来创建一个简单的流程图: ```html <ul class="flowchart"> <li> <span class="step">Step 1</span> <span class="description">Description of step 1</span> </li> <li> <span class="step">Step 2</span> <span class="description">Description of step 2</span> </li> <li> <span class="step">Step 3</span> <span class="description">Description of step 3</span> </li> </ul> ``` ```css .flowchart { list-style: none; padding: 0; margin: 0; } .flowchart li { display: flex; align-items: center; margin-bottom: 20px; } .flowchart li::before { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; background-color: #ccc; margin-right: 10px; } .flowchart li:first-child::before { background-color: #00c853; } .flowchart li:last-child::before { background-color: #f44336; } .flowchart .step { font-weight: bold; margin-right: 10px; } .flowchart .description { flex: 1; } ``` 在这个例子中,我们使用了一个无序列表(ul)来表示流程图,并将其设置成没有圆点样式(list-style: none),没有内边距和外边距(padding: 0, margin: 0)。每个流程图步骤都用一个列表项(li)表示,它们使用了flexbox布局,使得步骤和描述在同一行,并且垂直居中对齐。我们使用了伪元素(::before)来在每个步骤前面添加一个圆形图标,并设置不同的背景颜色来表示不同的步骤。步骤和描述都是用span元素包裹,并使用样式规则来设置它们的外观和布局。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值