<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>0079</title>
<style type="text/css">
body{
background: #000;
margin: 111px;
}
#rect3{
fill: #F88;
}
.rect1:hover{
fill:#F0F;
}
.rect2:hover{
fill:#F33;
}
</style>
</head>
<body>
<svg height="999px" width="999px">
<rect id="rect1" class="rect1" height="111px" width="111px" fill="#3F3"/>
<rect id="rect2" class="rect2" height="111px" width="111px" fill="#3FA" x="222px"/>
<rect id="rect3" height="33px" width="333px" y="222px"/>
</svg>
</body>
</html>
{:10_281:}get新标签svg 本帖最后由 小脑斧 于 2020-4-11 17:07 编辑
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>svg玩法练习</title>
<style type="text/css">
body{
background: #000000;
margin: 111px;
}
.rect3{
fill: yellow;
}
.rect4{
fill: #ff8888;
}
.rect1:hover{
fill: #ff8888;
}
</style>
</head>
<body>
<svg height = "999px" width = "999px"><!--需指定px单位-->
<rect class="rect1" height="111px" width="111px" fill="#3f3"/>
<rect class="rect2" height="111px" width="111px" fill="#3fa" x="222px"/>
<rect class="rect3" height="90px" width="90px"x="121.5px" y="121.5px"/>
<rect class="rect4" height="33px" width="333px" y="222px"/>
</svg>
</body>
</html>
页:
[1]