简体   繁体   English

如何修改实现CSS选择选项?

[英]How to modify materialize css select option?

EDIT 编辑

I am trying to modify materialize select option's caret in such a way that that caret will go near to the horizontal line by modifying some default code, so from 我正在尝试以这样的方式修改实现选择选项的插入符号,即通过修改一些默认代码,插入符号将接近水平线,因此从

.select-wrapper .caret {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto 0;
    z-index: 0;
    fill: rgba(0,0,0,0.87);
}

to

.select-wrapper .caret {
    position: absolute;
    right: 0;
    top: 15px;
    bottom: 0;
    margin: auto 0;
    z-index: 0;
    fill: rgba(0,0,0,0.87);
}

top: 0; 最高:0; to top: 15px; 至顶部:15像素; , If i modify it on chrome inspect element, it takes effect but on my customize css file there is no effect. ,如果我在chrome inspect元素上对其进行了修改,它会生效,但是在我的自定义css文件上却没有任何效果。 I wonder why? 我想知道为什么?

As for the HTML: 至于HTML:

<div class="col s12 m8 l8">
    <select id="gender" name="gender_val">
        <option value="" disabled="" selected><< Pls select >></option>
        <option value="male">Male</option>
        <option value="female">Female</option>
    </select>
</div>

to where the div tag to be put is i really have no idea. 到哪里放置div tag是我真的不知道。 I just saw this on the browser inspect element: 我刚刚在浏览器inspect元素上看到了这一点:

在此处输入图片说明

Here is the image of what i am referring. 这是我所指的形象。

在此处输入图片说明

When you make the change in your CSS and inspect, do you see the change in the inspector? 当您在CSS中进行更改并进行检查时,您是否在检查器中看到了更改? If not, it's likely that Chrome's cache is bugging you... In this case you can access in incognito mode and check if the change is displayed. 如果不是,则可能是Chrome的缓存在困扰您...在这种情况下,您可以以隐身模式访问并检查是否显示更改。

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

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