Last active
October 24, 2018 01:56
-
-
Save leavlzi/7228590 to your computer and use it in GitHub Desktop.
CSS实现三角形缺口
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>CSS实现三角形缺口</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
</head> | |
<body> | |
<style type="text/css"> | |
html, body { | |
height: 100%; | |
} | |
.title-wrap{ | |
position: relative; | |
display: block; | |
width: 100px; | |
height: 100px; | |
background: #ff0000; | |
} | |
.wrap{ | |
height:100%; | |
} | |
.title-wrap b{ | |
position: absolute; | |
top: 45px; | |
right: 0px; | |
line-height: 0; | |
font-size: 0; | |
border-right: 7px solid #ffffff; | |
border-top: 7px dashed transparent; | |
border-bottom: 7px dashed transparent; | |
} | |
</style> | |
<div id="wrap"> | |
<div class="test"> | |
<span class="title-wrap"> | |
优惠 | |
<b></b> | |
</span> | |
</div> | |
</div> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment