HTML5----各种图形形状应用

border-radius属性
基本语法:
border-radius:1-4 length %/1-4 length (lenth为圆角半径长度)

应用1:

<html>
<head>
<style>
#{
padding:0;
margin:0;
}
#one{
width:400px;
height:400px;
background:rgb(0,100,255,0.5);
border-radius:50%;
float:left;
position:fixed;
}
#two{
float:left;
width:100px;
height:100px;
background:white;
border-radius:50px;
position:fixed;
left:150px;
top:150px;
}
</style>
</head>
<body>
<div id="one"></div>
<span id="two"</span>
</body>
</html>

效果图如下:
在这里插入图片描述

四格三角形应用:

<html>
<head>
<title>document</title>
<style>
div{
width:0;
width:0;
border-top:100px solid red;
border-bottom:100px solid yellow;
border-left:100px solid blue;
border-right:100px solid green
}
</style>
</head>
<body>
<div>
</div>
</body>
</html>

效果图如下:
在这里插入图片描述

八格三角形应用1:

<html>
<head>
<title>document</title>
<style type="text/css">
       #one{
       	width: 0;
                height:0;
       	border-top:100px solid #92D050; 
        border-bottom: 100px solid #FFFF00;
       	border-left: 100px solid #92D050;
       	border-right: 100px solid #FFFF00;
       }
       #two{
        width: 0px;
        height:0;
        left: 200px;
        top: -400px;
        border-top:100px solid #FF0000; 
        border-left: 100px solid #0070C0;
        border-right: 100px solid #FF0000;
        border-bottom:100px solid #0070C0;
        position: relative;
       }
       #three{
        width: 0px;
        height:0;
        border-top:100px solid black; 
        border-left: 100px solid #7030A0;
        border-right: 100px solid black;
        border-bottom: 100px solid #7030A0;
       }
       #four{
        width: 0px;
        height:0;
        left: 200px;
        top: -400px;
        border-top:100px solid white; 
        border-left: 100px solid white;
        border-right: 100px solid #00B0F0;
        border-bottom: 100px solid #00B0F0;
        position: relative;
      
       }
    </style>
</head>
<body>
      <div>
     <div id="one"></div>
     <div id="three"></div>
     <div id="two"></div>
     <div id="four"></div>
      </div>
</body>
</html>

效果图如下:
在这里插入图片描述

八格三角形应用2:

<html>
<head>
    <style type="text/css">
       #one{
        width: 0;
        border-top:100px solid #FF0000; 
        border-bottom: 100px solid #70AD47;
        border-left: 100px solid #70AD47;
        border-right: 100px solid #FF0000;
       }
       #two{
        width: 0px;
        left: 200px;
        top: -400px;
        position: relative;
        border-top:100px solid #44546A; 
        border-left: 100px solid #44546A;
        border-right: 100px solid #FFFF00;
        border-bottom: 100px solid #FFFF00;
       }
       #three{
        width: 0px;
        border-top:100px solid #7030A0; 
        border-left: 100px solid #7030A0;
        border-right: 100px solid #002060;
        border-bottom: 100px solid #002060;
       }
       #four{
        width: 0px;
        left: 200px;
        top: -400px;
        position: relative;
        border-top:100px solid #FFC000; 
        border-left: 100px solid #00B0F0;
        border-right: 100px solid #FFC000;
        border-bottom: 100px solid #00B0F0;
       }
    </style>
</head>
<body>
     <div id="one"></div>
     <div id="three"></div>
     <div id="two"></div>
     <div id="four"></div>
</body>
</html>

效果图如下:
在这里插入图片描述

爱心应用:

<html>
<head>
   <style type="text/css">
       #a{
   	background-color: red;
   	height:100px;
   	width: 100px;
   	transform: rotate(45deg);
   	}
    #a:before{
        height: 100px;
        width: 100px;
        left:-45px;
        top:-0px;
        position: absolute;
        display: block;
        border-radius: 80px;
        background-color: red;
        content: " ";
      }
      #a:after{
        height: 100px;
        width: 100px;
        left:0px;
        top:-45px;
        display: block;
        position: absolute;
        border-radius: 80px;
        background-color: red;
        content: " ";
      }
      div{
        position: absolute;
        left: 350px;
        top:99px;
       }
    </style>
   </head>
<body>
        <div id="a"></div>
</body>

效果图如下:
在这里插入图片描述
五角星应用:

<html>
<head>
    <meta charset="utf-8">
    <style type="text/css">
    #a {
        width: 0px;
        height: 0px;
        margin: 70px 0;
        position: relative;
        display: block;
        color: yellow;
        border-bottom: 80px  solid yellow;
        border-left:   100px solid transparent;
        border-right:  100px solid transparent;
         }
    #a:before {
      width: 0;
      height: 0;
      top: -45px;
      left: -65px;
      position: absolute;
      display: block;
      border-bottom: 80px solid yellow;
      border-left: 30px solid transparent;
      border-right: 30px solid transparent;
      content: '';
      transform: rotate(-35deg);
     }
    #a:after {
      width: 0px;
      height: 0px;
      top: 3px;
      left: -105px;
      position: absolute;
      display: block;
      color: yellow;
      border-bottom: 70px solid yellow;
      border-right: 100px solid transparent;
      border-left: 100px solid transparent;
      content: '';
      transform: rotate(-70deg);
       }
    </style>
</head>
<body>
           <div id="a"></div>
</body>
</html>

效果图如下:
在这里插入图片描述
正方形应用:

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值