简体   繁体   English

定位背景重复属性

[英]Positioning the background-repeat Property

I have this drop-down button, which is styled using this css: 我有一个下拉按钮,使用以下css样式设置:

.styled-select {
        background: url(resources/img/selector.png) no-repeat right;
        background-color: white;
        width: 305px;
        height: 42px;
        position: relative;
        margin: 0 auto;
        box-shadow: 0 2px 2px 0 #C2C2C2;
    }

The result is shown in this picture: 结果如图所示:

在此处输入图片说明

As you see, using no-repeat right made the selector.png go to the right end. 如您所见,使用no-repeat right可使selector.png移到右端。 I want to know if there is any solution to position that arrow in order to shift it a little to the left as in this picture: 我想知道是否有任何解决方案来定位该箭头,以便将其向左移动一点,如图所示:

在此处输入图片说明

尝试像这样更改background-position属性value

background: url(resources/img/selector.png) no-repeat top 96%;

You have to use right propety like this 你必须这样用正确的方式

.styled-select {
    background: url(resources/img/selector.png) no-repeat right;
    background-color: white;
    width: 305px;
    height: 42px;
    position: relative;
    padding:10px;
    margin: 0 auto;
    box-shadow: 0 2px 2px 0 #C2C2C2;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM