网站的内容应有尽有,企图里显露出良多别出心裁,页面的框架大概页面中的小细节小成果都能显露,出来。在这些网站的建造中,有一些小成果经常能用到,借此纪录上去,
网站搭建,下面的这几种小成果都是比力经常使用的,并且都是用css就能完成的。比方:页面中的一些下拉框大概气泡框的小三角形、页面内容的翻转、笔墨的配景和头部的搜刮框的成果。诸多这些成果构成一个个很不错的网站。
建造下拉框的小三角形,以下图:
Css以下:
.other ul li::before{
content: '';
position: absolute;
top: -8px;
left: 50%;
display: inline-block;
width: 0;
height: 0;
border-style: solid;
border-width: 0 8px 8px;
border-color: transparent transparent #d5d5d5 transparent;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
border-width点窜小三角的巨细,border-color的能够设置小三角的色采和指向方向。
页面内容翻转成果,以下图:
能够用两个div做成正面和不和的内容,经由过程翻迁移转变效将内容翻转,主要的html+css以下:
Html:
Ccs:
.caseli .above{
padding-top: 7%;
background: #FFFFFF;
position: relative;
-webkit-transform: rotateX(0deg) rotateY(0deg);
-webkit-transform-style: preserve-3d;
-webkit-backface-visibility: hidden;
-moz-transform: rotateX(0deg) rotateY(0deg);
-moz-transform-style: preserve-3d;
-moz-backface-visibility: hidden;
transform: rotateY(0deg);
-webkit-transition: all .4s ease-out;
-moz-transition: all .4s ease-out;
transition: all .4s ease-out;
z-index: 24;
box-shadow: 0px 5px 38px rgba(0,69,87, 0.09);
border-radius: 10px;
}
.caseli:hover .above{
z-index: 35;
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
transform: rotateY(180deg);
-webkit-transition-delay: .2s;
-moz-transition-delay: .2s;
transition-delay: .2s;
}
.caseli .below{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: url(../images/img32.jpg) center no-repeat;
background-size: cover;
box-shadow: 0px 5px 38px rgba(0,69,87, 0.09);
-webkit-transform: rotateY(-180deg);
-webkit-transform-style: preserve-3d;
-webkit-backface-visibility: hidden;
-moz-transform: rotateY(-180deg);
-moz-transform-style: preserve-3d;
-moz-backface-visibility: hidden;
transform: rotateY(-180deg);
-moz-transition: all .4s ease-out;
-webkit-transition: all .4s ease-out;
transition: all .4s ease-out;
z-index: 13;
border-radius: 10px;
}
.caseli:hover .below{
display: block;
-webkit-animation: fadeIn 0.8s;
animation: fadeIn 0.8s;
}
.caseli:hover .below{
z-index: 46;
-webkit-transform: rotateX(0deg) rotateY(0deg);
-moz-transform: rotateX(0deg) rotateY(0deg);
transform: rotateY(0deg);
-webkit-transition-delay: .2s;
-moz-transition-delay: .2s;
transition-delay: .2s;
}
Css完成给笔墨增加配景,以下图
.i-title .tsp{
position: relative;
display: inline-block;
padding: 0px 166px;
font-weight: bold;
font-family: "syh";
color: #ec3f41;
text-transform: uppercase;
line-height: 1.2;
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
color: transparent;
background-image: url(../images/img9.jpg);
background-position: center left;
background-size: cover;
}
页面中罕见的搜刮框,鼠标移上去以后宽度就会变大,以下图:
Css:
.searchbox{
width: 80px;
height: 40px;
border-radius:40px;
border:1px solid #EEEEEE;
position: absolute;
right: 0;
outline:none;
text-indent:12px;
color: #333333;
font-size:15px;
padding:0;
-webkit-transition:width 0.4s;
transition:width 0.4s;
}
.searchbox:hover{
width:200px;
}