2

I have a select field and no matter what I do I can't get the text to stop sticking to the top of the box.

Here is an example of how it looks:

enter image description here

If I use padding-top then it pushes down the arrow button as well, which I don't want. I have also tried line-height with no effect.

Here is the relevant CSS:

#header .nav .misc .search .search_holder .cats select {
    width: 111px;
    height: 29px;
    border-top: 1px solid #97ad00;
    border-bottom: 1px solid #97ad00;
    border-left: none;
    border-right: none;
    padding-left: 8px;
    font-family: Roboto, Arial;
    font-size: 14px;
    background: url('../images/search-cats-bg.png') 0 0 repeat-x;
    color: #b2b2b2;
}

#header .nav .misc .search .search_holder .cats select option {
    padding-top: 5px;
}

#header .nav .misc .search .search_holder .cats select option.last {
    padding-bottom: 5px;
}

Edit: Added HTML.

HTML:

<div class="cats">
    <select id="search_cats" class="search_cats" name="cat">
        <option value="all">All Categories</option>
        <option value="sports">Sports Cards</option>
        <option value="gaming">Gaming Cards</option>
        <option value="non-sport">Non-Sport Cards</option>
        <option value="supplies" class="last">Supplies & Storage</option>
    </select>
</div>

Why is it doing this and how can I fix it?

Edit: Seems it can't really be fixed, found this question:

I want to vertical-align text in select box

If you look at the answer from "Shelly Skeens" then you will find that FF decided to set the built-in line-height to normal !important and hence it can't be overridden.

Community
  • 1
  • 1
Brett
  • 19,449
  • 54
  • 157
  • 290

2 Answers2

0

try add that

.cats * { line-height: 16px; }
Alvarez
  • 1,303
  • 1
  • 10
  • 28
  • Add it where? As I stated I have already tried using line-height and it didn't work. :( – Brett Oct 17 '12 at 12:11
  • i tested your code works fine, maybe something else, could you please post everything? header and the nav too –  Oct 17 '12 at 12:18
0

works fine on google chrome ,and google developer tools answer to select box qestion

Jimmy Obonyo Abor
  • 7,335
  • 10
  • 43
  • 71