Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8822863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:12:46+00:00 2026-06-14T06:12:46+00:00

I have a drop down list which I styled but I still can’t get

  • 0

I have a drop down list which I styled but I still can’t get why does the text always align differently in chrome and in firefox. I tried adding text-align:center; on my css and the firefox make the selection list centered but is not centered vertically while in chrome it doesn’t centered it all but at least it’s verticall alignment is centered. Here’s the output of it currently (text-align center part removed):

Firefox rendering:
enter image description here

Chrome rendering:
for chrome

this is my css code so far:

div container for the dropdown:

.container {
 background-color:#424141;
 border:1px solid #424141;
 width:280px;
  height:40px;
  font-size:13pt;
  font-weight:bold;
  padding-right: -20px;
  border-radius: 10px;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
}

and for the drop down:

.dropdown  {
 background-color:#424141;
  border:1px solid #424141;
  position:absolute;
  color: #000000;
  width:280px;
  height:40px;
  font-size:13pt;
  font-weight:bold;
  border-radius: 10px;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
}

and here’s the result after adding text-align:center; on the dropdown class:

result 2

in chrome it remains the same as above.

Here’s the html code for this. well it’s inside a table I think I can just skip the other part:

<tr>
    <td><p class="titles">City</p></td>
    <td><div class="container"><select name="city" tabindex="16" class="dropdown">
        <?php foreach ($cities as $city1): ?>

            <option <?php echo "value='".$city1['city']."'"; if($city1['city']==$city){echo "selected='selected'";} ?>>
        <?php echo $city1['city']; ?>
            </option>

        <?php endforeach ?>
        </select></div></td>
</tr>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T06:12:48+00:00Added an answer on June 14, 2026 at 6:12 am

    What you are trying to do cannot be done cross-browser using HTML/CSS because the HTML/CSS specification doesn’t actually SAY how CSS or styling is supposed to be applied to form elements. Actualy you can write your own dropdown with javascript:

    html:

    <div id="search_result_fake_container">
        <input id="search_result_fake" value="- All Categories -">
        <div id="search_result_fake_div"></div>
    </div>
    <div id="search_result_present_list">
        <div class="search_result_list_item" id="search_result_item_1" style="text-align:center;">item1</div>';
        <div class="search_result_list_item" id="search_result_item_2" style="text-align:center;">item2</div>';
        <div class="search_result_list_item" id="search_result_item_3" style="text-align:center;">item3</div>';
    </div>
    

    js:

    <script type="text/javascript">
        $(document).ready(function () {
            $("#search_result_fake_div").live("click", function () {
                $("#search_result_present_list").show("fast");
            });
    
            $("#search_result_present_list").live("mouseleave", function () {
                $("#search_result_present_list").hide();
            });
    
            $(".search_result_list_item").live("click", function () {
                $("#search_result_fake").val($(this).html());
                $("#search_result_present_list").hide();
            });
        })
    </script>
    

    css:

    #search_result_fake {
        -moz-box-sizing: border-box; /* for Firefox */
        -webkit-box-sizing: border-box; /* for Safari $ Chrome */
        box-sizing: border-box; /* for IE $ Opera */
        padding-left: 5px;
        width: 100%;
        font-size: 90%;
        outline: none;
        -moz-border-radius: 15px;
        -webkit-border-radius: 15px;
        border-radius: 15px;
        height: 100%;
    }
    
    #search_result_fake_div {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        cursor: pointer;
    }
    
    #search_result_present_list {
        display: none;
        position: absolute;
        text-align: left;
        top: 85px;
        left: 65%;
        font-size: 90%;
        overflow: auto;
        background-color: #eae7e7;
        border: #6f6f6f solid 1px;;
        height: 190px;
        width: 23%;
        z-index: 4;
    }
    

    css is copy paste but i hope you understand what i meen

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a drop-down list containing classifications of currencies which can be instantiated as
I have a drop-down list which is generated based on the following sql query:
I have a drop down list which is dynamically generated using ajax on page
I have one drop down list in my page, which contains two options. What
I have code which has a drop down list. And when a certain option
i have a drop down list which is populated dynamically from database table i.e
I have a page, it has a drop down list, which contains the names
I have a drop down list on a form view which are both bound
I have made a drop down menu which is working fine, but when i
I have a drop-down list which gathers data from the database and a textbox

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.