html手机端自适应头部,html5写自适应头部

仿写的一个聚划算的例子

0818b9ca8b590ca3270a3433284dd417.png

*{

margin: 0;

padding: 0;

}

header{

width: 100%;

height: 45px;

background-color: rgba(242,24,97,.95);

display: -webkit-box;

}

header .logo{

width: 110px;

height: 45px;

background-color: orange;

position: relative;

}

header .logo h1{

width: 65px;

height: 20px;

background: url(images/logo.png);

/*margin: 0 auto;*/

left: 50%;

top: 50%;

position: absolute;

/*css3中的变形*/

-webkit-transform:translate(-50%,-50%);

/*SEO的考量,类似于缩进*/

text-indent: -9999px;

/*里面的自适应*/

-webkit-background-size: cover;

background-size: cover;

}

header nav{

-webkit-box-flex:1;

}

header nav ul{

/*一条上*/

display: -webkit-box;

/*去掉li前的原点*/

list-style: none;

}

header nav ul li{

/*一条线上成比例*/

-webkit-box-flex:1;

/*行间距可以将文字顶居中*/

line-height: 45px;

text-align: center;

}

header nav ul li a{

/*去掉a下的横线*/

text-decoration: none;

color: white;

}

header .but{

width: 110px;

height: 45px;

background-color: orange;

}

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值