skip to Main Content

How to change the font size of the option in the selected dropdown menu in css?

    <div class="col-md-3">
                    <label for="role">نقش پرسنل :</label>
                </div>
                <div class="form-group col-md-5">
                    <select class="form-control" id="role" name="SelectedRoles">
                        <option selected>معاونت مورد نظر را انتخاب کنید</option>
                        @foreach (var item in Roles)
                        {
                            <option value="@item.RoleId"> @item.RoleTitle</option>
                        }
                    </select>
                </div>

enter image description here

3

Answers


  1. #role{ font-size: 20px !important; } // this will override any default values
    
    Login or Signup to reply.
  2. For selection option we can apply font-size as :

    .form-control ::selection option {
      font-size: 16px !important;  /*you can replace it with desired font size */
    }
    
    Login or Signup to reply.
  3. Try this:

    select#role {
      font-size: 24px;
    }
    <div class="col-md-3">
      <label for="role">نقش پرسنل :</label>
    </div>
    <div class="form-group col-md-5">
      <select class="form-control" id="role" name="SelectedRoles">
        <option selected>معاونت مورد نظر را انتخاب کنید</option>
           @foreach (var item in Roles)
           {
              <option value="@item.RoleId"> @item.RoleTitle</option>
           }
       </select>
     </div>
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search