使用CSS畫出“鷹嘴”訊息框
阿新 • • 發佈:2018-12-29
必須明白radius可以設定為兩個值,寬半徑、高半徑
,如果只設置為一個值,則寬半徑 = 高半徑
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鳥教程(runoob.com)</title>
<style>
#parent{
position:absolute;
top:100px;
left:100px;
right:0px;
}
#content{
display:inline-block;
background-color :blue;
border-radius:5px;
padding:20px
}
#content::before
{
content:'';
border-bottom: 15px solid blue;
border-left: 0px solid blue;
border-bottom-left-radius: 20px 20px;
height:20px;
width:20px;
position:absolute;
top:5px;
left:-15px;
}
</style>
</head>
<body>
<div id="parent">
<div id="content">asd</div>
</div>
</body>
</html>