How to ignore parent css style

前端 未结 10 1311
逝去的感伤
逝去的感伤 2020-12-23 18:58

I\'m wondering how to ignore a parent style and use the default style (none). I\'ll show my specific case as an example but I\'m pretty sure this is a general question.

相关标签:
10条回答
  • 2020-12-23 19:10

    You should use this

    height:auto !important;

    0 讨论(0)
  • 2020-12-23 19:10

    I had a similar situation while working on a joomla website.

    Added a class name to the module to be affected. In your case:

    <select name="funTimes" class="classname">
    

    then made the following single line change in the css. Added the line

    #elementId div.classname {style to be applied !important;}
    

    worked well!

    0 讨论(0)
  • 2020-12-23 19:18

    If I understood the question correctly: you can use auto in the CSS like this width: auto; and it will go back to default settings.

    0 讨论(0)
  • 2020-12-23 19:20

    It would make sense for CSS to have a way to simply add an additional style (in the head section of your page, for example, which would override the linked style sheet) such as this:

    <head>
    <style>
    #elementId select {
        /* turn all styles off (no way to do this) */
    }
    </style>
    </head>
    

    and turn off all previously applied styles, but there is no way to do this. You will have to override the height attribute and set it to a new value in the head section of your pages.

    <head>
    <style>
    #elementId select {
        height:1.5em;
    }
    </style>
    </head>
    
    0 讨论(0)
提交回复
热议问题