The options in the form select dropdown are not correctly positioned

I am new to using Jquery. I am attempting to create a submit form with a select option in it. However, the drop-down options are not displaying correctly. They appear slightly above and to the left of where they should be.https://i.sstatic.net/xZecM.png

I would like these options to be positioned just below the "select" object.

Below is my Code:

body {
  background: #333;
}
select,
option {
  background: rgba(255, 255, 255, 0.4) no-repeat scroll 16px 16px;
  width: 276px;
  height: 48px;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 18px;
  color: #fff;
  padding-left: 45px;
  padding-top: 12px;
  margin-bottom: 20px;
  overflow: hidden;
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  border-radius: 4px;
  -moz-background-clip: padding;
  -webkit-background-clip: padding-box;
  background-clip: padding-box;
}
<body id="gradient" style="height:90vh"> 
<div id='title'class="container" style="border-style:solid;border-width:2px;border-color:#ffffff;height:23vh;width:45vw;margin: 0 auto;margin-top:150px;"> 
<h1 style="color:#ffffff;font-size: 250%;font-weight: 400;margin-top:60px" align="middle">VATek Web Configuration</h1>
</div>

<form name="broadcastform" id="broadcastform" method="post" action="">


<h1 id="broadcast_title" style="color:rgba(255,255,255,0.7);font-size: 250%;font-weight: 400;margin-top:-10px" align="middle">BROADCAST</h1>
<hr style="border-color:#ffffff;weight:40%;margin:0 auto;margin-bottom:20px">
<center class="page_intro">
<div style="margin-top:-1%;color:rgba(255,255,255,0.7);width:90%;margin-bottom:6.5%" class="page_
intro">
<font size="6" style="line-height: 150%"class="page_intro"><center>Welcome!</center></font>
<font size="5" style=" padding-top:20px;line-height: 150%;font-weight:normal;opacity:0.7"class="page_intro"><center>This is a Tool to Configure and Broadcast Your Modulator. Please Follow the Steps and Fill in the Parameter Fields for Your Preference. Enjoy the Tour !</center></font>
</div>
</center>
<!-- Page Basic Setting --> 
<select name="InputSource"  class="required page_basic" style="margin-left:23%" form="broadcastform" >

<option value="">Broadcast Input</option>             
<option value="0">HDMIPhy</option>             
<option value="1">USB Streaming</option>             
<option value="2">MPEC-TS Interface</option>             
<option value="3">VIP(Ethernet)</option>         
</select>
<select name="ModulationMode"class= "page_basic required" style="margin-left:23%" form="broadcastform">             
<option value="">Modulation Mode</option>             
<option value="1">ATSC</option>             
<option value="2">DTMB</option>             
<option value="3">DVB</option>             
<option value="4">ISDB</option>         
</select>           

Is there a way to center the text of those options within the box? I am struggling to find a solution to adjust the position of the dropdown box.

form {
margin-left:auto;
margin-right:auto;
margin-top:80px;
width: 45vw;
height: 70vh;
padding:30px;
border: 1px solid rgba(0,0,0,.2);
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
background: rgba(0, 0, 0, 0.4); 
-moz-box-shadow: 0 0 13px 3px rgba(0,0,0,.5);
-webkit-box-shadow: 0 0 13px 3px rgba(0,0,0,.5);
box-shadow: 0 0 13px 3px rgba(0,0,0,.5);
overflow: hidden; 
}

Answer №1

<select name="InputSource"  class="required page_basic" style="text-align: center; margin-left:23%" form="broadcastform" >

            <option value="">Broadcast Input</option>             
            <option value="0">HDMIPhy</option>             
            <option value="1">USB Streaming</option>             
            <option value="2">MPEC-TS Interface</option>             
            <option value="3">VIP(Ethernet)</option>         
</select>
<select name="ModulationMode"class= "page_basic required" style="text-align:center; margin-left:23%" form="broadcastform">             
            <option value="">Modulation Mode</option>             
            <option value="1">ATSC</option>             
            <option value="2">DTMB</option>             
            <option value="3">DVB</option>             
            <option value="4">ISDB</option>         
    </select>  

Kindly review this content. Everything appears to be in order. Please have a look.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilizing Vue to create a button within a popup window

Utilizing the vue2-google-maps package, I have created a custom popup. Within this custom popup, there is a button that is intended to open a new popup in place of the existing one. Here is the HTML code: <gmap-info-window :options="infoOptions" : ...

Having trouble loading HDRI image as environment using Three.js

I recently started using Three.js and am currently tackling a project that involves utilizing an HDRI file for environmental mapping for lighting and reflection purposes. I've been experimenting with loading HDRI files using the HDRCubeTextureLoader a ...

How to activate an event using a Bootstrap switch in VueJS 2

Dealing with a bootstrap switch has been quite interesting. In JQuery, managing it is simple, just follow the documentation: $('input[name="my-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) { console.log( ...

`Error encountered when attempting to convert date with Angular JS filter`

Utilizing angular js filter in the controller for date formatting. A user selects a date from a uib-datepicker-popup. The goal is to format this date using ISO 8601 (yyyy-mm-dd) date format. Upon logging the user-selected date, the output is as follows: S ...

Tips for creating a full-width fixed header

I've implemented a fixed header in a bootstrap container and I'm attempting to make the header fill 100% of the width without any margins or paddings. Here's a snippet of the HTML structure: <div class="container-fluid"> <div c ...

Can the presence of buttons and links improve mobile responsiveness?

I can't help but wonder about this. Is it user-friendly to create a div that looks like a button and has a 'click' event attached to it? Will all mobile browsers handle it accurately and always trigger the event when the div is clicked? In t ...

Remove outdated choices from subcategory menu upon JSON data retrieval

By using the onchange event in the parent dropdown (first dropdown), I am populating the child dropdown (second dropdown). Subsequently, upon selecting an option from the child dropdown, I automatically fill in three text boxes. However, I am facing an iss ...

When I utilize axios to send the request, the express routes for creating a new JSON entry in the mongo collection function correctly

Currently, I am working on building a course registration system that utilizes a form to send student data to a database. I have successfully created Express routes to add new entries to a mongo collection through a post request. Everything functions as ex ...

Remove input fields that were generated upon clicking a button

I'm facing an issue with my code that allows me to add inputs using @click="addInput()". However, I am struggling to delete specific inputs using @click="deleteInput(). When I try to delete an input with this.inputs.splice(index, 1), on ...

The behavior of the "checked" attribute in VueJS checkboxes does not always match their actual state

In this example, I have created a todo-list with checkboxes that can be checked or unchecked based on whether a task is completed or not. If you uncheck a checkbox in the "Complete tasks" section, the next checkbox will also appear unchecked even if it is ...

Express Form Validation: Ensuring Data Accuracy

I have recently learned that client-side form validations may not be sufficient to prevent malicious actions from users. It is recommended to also validate the form on the server-side. Since I am new to using express, can someone provide guidance on what s ...

What is the best way to ensure a floated image matches the height of its parent container?

I am facing an issue with setting the height of a logo within a footer div to match the height of the div itself. Using height: 100% doesn't seem to work as expected. Below is the relevant HTML: <footer> <img src="images/circle_logo.png" ...

AngularJS: Implementing bidirectional data binding between two separate controllers using a common service

I'm currently working on establishing a two-way data binding connection between two separate controllers and a shared service in AngularJS: app.factory("sharedScope", function($rootScope) { var scope = $rootScope.$new(true); scope.data = "ini ...

Choose elements in jQuery that lack a specific class

How can I efficiently select all elements with the .hi class that do not include the .image class? <div class="hi"> <div class="hue"> <div class="image"> 456 </div> </div> </d ...

Navigating a Bootstrap modal using arrow keys for scrolling - up and down

I attempted to address this issue by using the following code: // here, 'this' represents the modal $(this).focus(); Despite trying the above solution and even attempting to trigger a click event on it, I was unable to get it to work! UPDATE ...

The issue of a type error within the declaration section of a TypeScript file is causing complications in Angular or

When I attempted to run the below component, I encountered a type issue in my declaration. Here is the specific problem I am facing: Type '{ First: string[]; Second: string[]; Third: string[]; Four: string[]; }' is missing properties such as len ...

My website footer is falling short and not reaching the bottom of the page

I've encountered an issue where my footer is not extending all the way down the website, despite trying various solutions. Here's what I attempted: I used the following CSS properties: min-height: 100%; max-height: 100%; I included these prope ...

Next.js - utilizing dynamic API routes within nested folders

Currently, I am working on developing a basic API that reads a local JSON file. My goal is to create a dynamic API that can adjust based on the specific calls it receives. Within my API folder structure, I have: api --book ---[id].js ----content -----[id ...

Integrate an input field with a copy function similar to the GitHub clone view

Can anyone help me create a view with a tooltip similar to the one on Github? You can see the example here: https://i.sstatic.net/iBSof.png I attempted to use CSS but couldn't quite replicate the exact UI. Here is my current CSS code: [tooltip] { ...

What is the method to have VIM recognize backticks as quotes?

Currently working in TypeScript, I am hoping to utilize commands such as ciq for modifying the inner content of a template literal. However, it appears that the q component of the command only recognizes single and double quotation marks as acceptable ch ...