css之 斜线
方案一
.x {
border: solid 1px red;
width: 100px;
height: 100px;
position: relative;
background-color: transparent;
}
.x:before {
position: absolute;
top: 0px;
right:;
left:;
bottom:;
border-bottom: 100px solid red;
border-left: 100px solid transparent;
content: "";
}
.x:after {
position: absolute;
left: 1px;
right:;
top: 1px;
bottom:;
border-bottom: 99px solid white;
border-left: 99px solid transparent;
content: "";
}
.f {
border: solid 1px red;
width: 100px;
height: 100px;
position: relative;
background-color: transparent;
}
.f:before {
position: absolute;
top: 0px;
right:;
left:;
bottom:;
border-bottom: 100px solid red;
border-right: 100px solid transparent;
content: "";
}
.f:after {
position: absolute;
left:;
right: 1px;
top: 1px;
bottom:;
border-bottom: 99px solid white;
border-right: 99px solid transparent;
content: "";
}
x 是 斜线, f 是反斜线。
图:

附:CSS 图形:
css3激发想象/css3各种图形 http://www.cnblogs.com/wwcherish/archive/2012/09/18/2690336.html
CSS3机器猫: http://keleyi.com/keleyi/phtml/html5/3.htm
方案二
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><line x1="0" y1="0" x2="100%" y2="100%" stroke="black" stroke-width="1"/></svg>');
css之 斜线的更多相关文章
- DIV+CSS制作斜线效果记录
DIV+CSS 斜线效果很简单,只需设置一下CSS Border 的边框就能有斜线效果.代码分享给大家,你可以自己变通. 提示要注意两点:1.DIV宽高的定义.2.DIV在 IE6 中默认是有高度的. ...
- css画斜线(用于时间的显示)
- css划斜线
http://stackoverflow.com/questions/18012420/draw-diagonal-lines-in-div-background-with-css
- 谈谈一些有趣的CSS题目(九)-- 巧妙的实现 CSS 斜线
开本系列,谈谈一些有趣的 CSS 题目,题目类型天马行空,想到什么说什么,不仅为了拓宽一下解决问题的思路,更涉及一些容易忽视的 CSS 细节. 解题不考虑兼容性,题目天马行空,想到什么说什么,如果解题 ...
- 巧妙的实现 CSS 斜线(炫酷的小效果)
开本系列,谈谈一些有趣的 CSS 题目,题目类型天马行空,想到什么说什么,不仅为了拓宽一下解决问题的思路,更涉及一些容易忽视的 CSS 细节. 解题不考虑兼容性,题目天马行空,想到什么说什么,如果 ...
- Matplotlib数据可视化(3):文本与轴
在一幅图表中,文本.坐标轴和图像的是信息传递的核心,对着三者的设置是作图这最为关心的内容,在上一篇博客中虽然列举了一些设置方法,但没有进行深入介绍,本文以围绕如何对文本和坐标轴进行设置展开(对图像 ...
- css斜线
斜线 .demo{ display: inline-block; width: 400px; height: 100px; resize: both; overflow: auto; margin-t ...
- CSS练习-导航栏斜线分隔-利用伪元素
开始切第一张图了,第一个遇到的问题是顶部导航栏这里,用斜线分割.想到的思路是用伪类:before或者:after实现 先写html结构. <!-- 导航栏begin --> <div ...
- css实现栏目两边斜线的效果
实现效果: 具体实现代码: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...
随机推荐
- “VS2013无法连接远程数据库”解决方案
“VS2013无法连接远程数据库” 解决方案:以管理员身份登录CMD,输入netsh winsock reset并回车(注意,必须是已管理员身份运行,这个重置LSP连接) 或 netsh winsoc ...
- solrCloud 管理
创建collection: /soft/server/solr-4.10.0/example/scripts/cloud-scripts/zkcli.sh -cmd upconfig -zkhost ...
- clone()与clone(true)的区别
clone()方法用于复制一个元素,但是被复制出来的元素不具备复制的功能,如果希望被复制出来的元素也具备复制的功能,需要给clone()方法加上true这个参数,即clone(true). 例如: & ...
- Diagramming for WinForms 的安装和配置
Diagramming for WinForms 是MindFusion公司推出的商业版通用流程图控件. 运行环境: WIN7 + .Net4.0 + Visual2010 试用版控件下载地址:htt ...
- Linux/Unix双机建立信任教程
Linux/Unix双机建立信任教程 一 需要建立信任关系的2台主机都执行生成密钥输入ssh-keygen -t rsa之后全部默认回车,这样就会在/root/.ssh下生成密钥文件 [root@pl ...
- css样式表 格式与布局
1 样式表 内联样式表 内嵌样式表 外部样式表 2 选择器 标签选择器 <style type="text\css" class 选择器 以.开头 ID选择器 以#开 ...
- MATLAB - 图像基本操作
1.读入一幅图像 I = imread('lena.jpg');%给出图片路径即可,I是一个三维矩阵 J = rgb2gray(I); figure, imshow(I), figure, imsho ...
- eclipse 配置黑色主题
虽然以前也使用eclipse的黑色主题,但是配置起来稍微麻烦一点. 这里先声明,下面的方式适合最新版本的Eclipse Luna,旧的版本可以下载我提供的这个插件,并将其放在eclipse目录下的pl ...
- eclipse插件egit安装使用
转载http://blog.csdn.net/zhangdaiscott/article/details/16939165 安装问题解决: 1 Cannot complete the install ...
- 第一章 git指令与设置
相关指令: 1.从远程的master分支上创建新的分支,此时新分支内容与master分支内容相同: git checkout master; git branch newbranch; git che ...