background-position設置無效問題解決

html代碼部分:css

<div class="login_div_reg1">
    <label for="passwd" class="login_div_reg_tab1 pwd-label"></label>
    <input id="passwd" type="password" class="itxt" name="passwd" tabindex="1" autocomplete="off" value="" placeholder="密碼(6-16個字符)">
</div>

css代碼:html

.login_div_reg_tab1{
    width: 38px;
    height: 36px;
    border-right: 1px solid #bdbdbd;
    background: url(/images/icon/pwd-icons.png) no-repeat;
    float:left;
}
.login_div_reg1 .pwd-label{
    background-position: -48 0;
}

頁面訪問時,background-position設置無效。url

此時只須要把px加上便可。code

.login_div_reg1 .pwd-label{
    background-position: -48px 0px;
}
相關文章
相關標籤/搜索