css3这个头像形状可以写出来吗

html-css07

css3这个头像形状可以写出来吗,第1张

给你一个类似的吧,我学CSS3时候的小练习,画云的

效果图:

代码:

* {

    margin: 0

    padding: 0

}

body {

    background: #ccc

}

#cloud {

    width: 330px

    height: 120px

    background: #f2f9fe

    background: -webkit-linear-gradient(top, #f2f9f3 5%, #d6f0fd 100%)

    background: -moz-linear-gradient(top, #f2f9fe 5%, #d6f0fd 100%)

    background: -ms-linear-gradient(top, #f2f9fe 5%, #d6f0fd 100%)

    background: -o-linear-gradient(top, #f2f9fe 5%, #d6f0fd 100%)

    background: linear-gradient(top, #f2f9fe 5%, #d6f0fd 100%)

    border-radius: 100px

    position: relative

    margin: 120px auto 20px

}

#cloud:after, #cloud:before {

    content: ""

    position: absolute

    background: #f2f9fe

    z-index: -1

}

#cloud:after {

    width: 100px

    height: 100px

    top: -50px

    left: 50px

    border-radius: 100px

}

#cloud:before {

    width: 180px

    height: 180px

    top: -90px

    right: 50px

    border-radius: 200px

}

.shadow {

    width: 350px

    position: absolute

    bottom: -10px

    background: #000

    z-index: -1

    box-shadow: 0 0 25px 8px rgba(0, 0, 0, 0.4)

    border-radius: 50%

    -webkit-border-radius: 50%

} <div id="cloud"><span class='shadow'></span></div>

clear:both,并不是不允许左右有浮动元素,而是清除上面的浮动元素对自己的影响,如果它没有clear:both,那么它就会左浮动到第一排,在两个图标的后面

当元素浮动的时候,它们就脱离了文档流,就好像两片云朵在空中飘着,那么它们在地面上就不占位置,地面就是这个文档流,当你在后面的元素设置clear:both的时候,就给之前的飘着的云朵赋予了地面位置,其他元素不能占那个位置了

楼主能理解么

不是你现在用的这个吗?

如果不是的话告诉我你什么时候换掉的。

================================

你要的应该是这个,

预览:

http://hi.baidu.com/koala47/modify/preview/25422cd0938cae8fa0ec9c91.css

下载css:

http://hi.baidu.com//koala47/css/item/25422cd0938cae8fa0ec9c91.css

====

如果你知道怎么保存css,下面的就不用看了。

下载css后,在模板设置里,新建一个模板,先把里面的内容全部删除,在把下载的css全部复制进去,保存并应用就行了。