html - 定位 background-repeat 属性

标签 html css styles background-image

我有这个下拉按钮,它是使用这个 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;
    }

结果如图所示:

enter image description here

如您所见,使用 no-repeat right 使 selector.png 转到右端。我想知道是否有任何解决方案可以定位该箭头以便将其向左移动一点,如图所示:

enter image description here

最佳答案

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

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

关于html - 定位 background-repeat 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35696888/

相关文章:

html - 当视口(viewport)缩小时,具有百分比宽度的 Div 仍然环绕

php - 注册页面 HTML 未将表单数据发送到 php 代码

css - css 的 react-big-calendar 导入失败

html - 使图像出现在jsp中

html - 在响应式设计中并排维护 div

html - 我可以将 "overflow: hidden;"用于 Adsense 广告吗

html - 类似于 "table-layout:fixed"但仅适用于一个表列

css - 混淆 CSS 类/样式顺序

javascript - 按需 div 的真正随机颜色

javascript - HTML - 更改选择中文本的样式