css图标的写法

html-css015

css图标的写法,第1张

html代码部分

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>图标写法</title>

</head>

<body>

<div id="icon">

<span class="price">&#6550989.0</span>

  <a href="#" class="btn">去开团&nbsp&gt</a>

</div>

</body>

</html>

下面是css代码部分,处理了浏览器的兼容

<style>

#icon{display:inline-block}

.price{display:inline-blockbackground:#E60012font-size:40pxcolor:#ffffloat:leftpadding:0px 60pxheight:86pxline-height:86px-moz-border-radius-topleft:43px-moz-border-radius-bottomleft: 43px-webkit-border-top-left-radius:43px-webkit-border-bottom-left-radius:43pxborder-top-left-radius:43pxborder-bottom-left-radius:43px}

.btn{display:inline-blockbackground:#000font-size:40pxcolor:#ffftext-decoration:nonefloat:leftpadding:0px 60pxheight:86pxline-height:86px-moz-border-radius-topright:43px-moz-border-radius-bottomright: 43px-webkit-border-top-right-radius:43px-webkit-border-bottom-right-radius:43pxborder-top-right-radius:43pxborder-bottom-right-radius:43px}

</style>

效果图

html5 css3样式图标制作方法:

1、html代码:

<div id="boxes">

<div id="boxShortcode">border-radius: 40px (shortcode)</div>

<div id="box1">border-top-right-radius: 40px (same on both axis)</div>

<div id="box2">border-top-right-radius: 20px 40px (x <y) </div>

<div id="box3">border-top-right-radius: 40px 20px (x >y) </div>

</div>

2、css样式代码:

#boxes div { margin-bottom: 20pxheight: 50pxpadding-left: 20px }

#boxShortcode {

background: cyan

border-radius: 40px

}

#box1 {

background: red

border-top-right-radius: 40px

}

#box2  {

background: yellow

border-top-right-radius: 20px 40px

}

#box3 {

background: lime

border-top-right-radius: 40px 20px

}

3、运行结果: