5.css三角的做法

如上图所示,类似这样的小三角都可以通过以下代码写出:
.box1 {
width: ;
height: ;
/* border: 10px solid pink; */
border-top: 10px solid pink;
border-right: 10px solid red;
border-bottom: 10px solid blue;
border-left: 10px solid green;
}这样的代码出现的样式如下图

- 若把4条边中的三条边换成透明色,则会出现三角的样式,代码如下:
.box2 {
width: ;
height: ;
border: 50px solid transparent;
border-left-color: pink;
margin: 100px auto;
}
- 京东的样式制作,如下代码:
.jd {
position: relative;
width: 200px;
height: 200px;
background-color: pink;
}
.jd span {
position: absolute;
top: -10px;
right: 0px;
width: ;
height: ;
border: 5px solid transparent;
border-bottom-color: red;
}
<div class="jd">
<span></span>
</div>
5.css三角的做法的更多相关文章
- 小技巧-CSS 三角的做法
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- CSS三角的写法(兼容IE6)
目录 简介 优点 原理 1. 先创建一个div 2. 然后给div设定边框. 3. 给div的四个边框都设置不同的颜色 4. 把宽度和高度都变成0 5. 其余角为透明 6. 兼容IE6浏览器 造成这样 ...
- 【27前端】在线css三角
我们都知道利用css边框的属性可以画出三角形,这里为了方便,我做了一个简单的demo页面供大家使用. 在线css三角
- css三角块
html: <div class="angle"></div> css: .angle{ width: 0px; height: 0px; border-b ...
- 不用图片做的三角语言框效果,纯样式编写,css三角样式写法
2010-07-05 19:57:28 博主 回复 用户昵称 在秋日真的有轻柔吧. 上边效果与理想的有误差,代码布不上去,下边是源代码,另行保存后查看真正效果,下图是真正效果,区别在三角处,里面颜 ...
- css 三角实例
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...
- css 三角
http://peunzhang.github.io/demo/css_angle/index.html
- css 三角图标
.triangle-right{ display: inline-block; width: 0; height: 0; border-top: 6px solid transparent; bord ...
- 案例- CSS 三角加强
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
随机推荐
- 李宏毅-Network Compression课程笔记
一.方法总结 Network Pruning Knowledge Distillation Parameter Quantization Architecture Design Dynamic Com ...
- 第24课经典问题(中)-----关于const对象的疑问
关于const对象的疑问const关键字能否修饰类的对象?如果可以,有什么特性?const关键字能够修饰对象const修饰的对象为只读对象只读对象的成员变量不允许被改变.(对象是只读的,成员变量不允许 ...
- 解决Error: ENOENT: no such file or directory, scandir 'xxx\node-sass\vendor'
解决方案是执行以下方法: npm rebuild node-sass
- 201871010108-高文利《面向对象程序设计(java)》第十三周学习总结
项目 内容 这个作业属于哪个课程 <任课教师博客主页链接> https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 <作业链接地址> ht ...
- Tkinter 鼠标键盘事件(一)
一: 鼠标事件 <Button-1> 鼠标左键单击 ...
- java.util.Base64
Base64 简单使用 java.util.Base64 package com.mozq.sb.jwt01.config; import java.nio.charset.Charset; impo ...
- git 清空所有commit记录
说明:例如将代码提交到git仓库,将一些敏感信息提交,所以需要删除提交记录以彻底清除提交信息,以得到一个干净的仓库且代码不变 1.Checkout git checkout --orphan late ...
- 7 Exciting Uses of Machine Learning in FinTech
https://rubygarage.org/blog/machine-learning-in-fintech Machine learning (ML) has moved from the per ...
- nexus php composer host 模式repo 试用
前边有介绍以及运行过基于nexus proxy 模式的php composer(其中也有一些坑),以下是关于host 模式的 简单使用 环境准备 docker-compose 文件 version ...
- 前端性能优化&&网站性能优化
加载优化:1.合并css.JavaScript 2.合并小图片,使用精灵图 3.缓存一切可缓存的资源 4.使用长cache 5.使用外联式引用css.JavaScript 6.压缩HTML.CSS.J ...