background问题

background问题

.header{

height: 60px;

position: relative;

background-color: #000;

}

.header__logo{

position: absolute;

background-image: url('../img/logo.png') left center no-repeat;

color: #fff;

width: 150px;

height: 60px;

line-height: 60px;

font-size: 24px;

}

为什么这样看不到logo图片

正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
Hbrsql 2017-03-17 15:24:55

background-image的值是 url('......') ; 

不应包含position及repeat信息.

background-image: url('../img/logo.png') left center no-repeat;

/*改成background: url('../img/logo.png') left center no-repeat;试试*/

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师