CSS, overwrite height of all select dropdowns?

后端 未结 7 889
夕颜
夕颜 2021-01-05 16:44

how would i reference, so i could overwrite, all of the select boxes so i can overwrite the default height? I\'m familiar when i create elements using a class, but im unsure

7条回答
  •  心在旅途
    2021-01-05 17:07

    100% JS solution (with jquery)

    $("select").height("120px");
    

    100% JS solution (without jquery)

    var selects = document.getElementsByTagName("select");
    for(i = 0;i < selects.length; i++) {
        selects[i].style.height = "120px";
    }
    

    100% CSS solution

    select {
        height: 100px !important;
    }
    

提交回复
热议问题