Issues with inconsistent behavior of the select option in a form

Having some trouble with my form code. When I checked the web page, there seems to be an extra element that shouldn't be there. You can view the webpage https://i.sstatic.net/pu4ef.jpg. Inspecting it in browser developer mode, I found this extra element https://i.sstatic.net/DvfJK.jpg. Can you please help me identify the mistake? Here is the code snippet:

<body>              
    <h1 style="text-align:center;font-size:50px;">Online Stationery Management System (OSMS) </h1>
    <div class="login-box">
    <h1 >Login</h1>
    <form  name="signin" method="post">
    <div class="select2">
    <i class="fas fa-user-lock" style="color:black; padding:5px;">&nbsp;Role</i>
    <select name="role" id="role" >
    <option value=""></option>
    <option value="user">USER</option>
    <option value="rec">Recommending Officer</option>
    <option value="store">Store</option>
    </select>
  </div>
  <div class="textbox">
    <i class="fas fa-user" style="color:black"></i>
    <input type="text" placeholder="Username" name="uin" autocomplete="off">
  </div>

  <div class="textbox">
    <i class="fas fa-lock" style="color:black"></i>
    <input type="password" placeholder="Password" name="password" autocomplete="off">
  </div>
 
  <input type="button" class="btn1" value="Forget Password" style="width:65%;margin-right:5px;">
  <input type="submit" class="btn" name="signin"value="Sign in" style="width:30%">
</div>
</form>

Here is my CSS code for the file:

.select2 {
  width: 100%;
  overflow: hidden;
  font-size: 20px;
  padding: 4px 0;
  margin: 4px 0;
  border-bottom: 2px solid black;
  background-color: transparent;
}

.select2 option{
    width: 26px;
    background-color: none ;
    border: none;
    background: none;
  color: blue;
  font-size: 20px;
  font-weight:bold;
   float: left;
  margin: 0 10px;
  white-sapce: no-wrap;
  text-overflow: ellipsis;
  background-color: none;
}
.select2 select{
  height: 30px;
  background-color: transparent;
  border: none;
  font-size: 15px;
  font-weight:bold;
}

.select2::after {
  !content: 'Select Role';
  font-family: 'material icons';
  font-size: 24px;
  color: red;
  position: absolute;
  right: 10px;
  top: 10%;
  transform: translateY(-50%);
  pointer-events: none;
}

Answer №1

It appears that Select2 javascript library is being utilized, potentially unintentionally, as it is replacing the default select with custom elements.

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

Can you suggest a more effective method for changing the color of buttons?

While the title provides some context, allow me to elaborate further. I've been working on a website for quite some time now. Each section of the website features 3 buttons, each highlighted in a unique color. My question is, is there a more streamlin ...

What is the best way to eliminate the blue color from a Boostrap 5.3 accordion item when it is opened?

As shown in these two images, I am looking to remove the blue color and blue border when opened: https://i.sstatic.net/vOIna.png https://i.sstatic.net/7eLfK.png <div class="accordion-item"> ...

Issue encountered while implementing async functionality in AngularFireObject

I'm encountering difficulties with the async feature in AngularFireObject. Is there a solution available? Snippet from HomePage.ts: import { AngularFireObject } from 'angularfire2/database'; export class HomePage { profileData: Angu ...

Upon the initial gallery load, the images are appearing on top of each

Currently, I am working on creating a gallery page for my website using the Isotop filtering plugin. To view the live gallery, you can visit: carroofies.com/gallery The main issue I am encountering is with the initial load of the page, where the images ov ...

Replicate the ctrl+/- function through coding

While browsing with your browser, you have the ability to adjust the font size by using CTRL + + or CTRL + -. Is there a way to replicate this functionality through code, such as with JavaScript? I am looking to add buttons on my website that allow users ...

Incorporate new content into a jquery mobile listview on the fly

I'm attempting to use JavaScript to dynamically populate a listview with items. Here is the code I have written: //Function to load data fields for items dynamically function initialiseFields(listViewId){ for(var i = 0; i < 10; i++){ ...

Occupying the entire width of a screen

Struggling to tidy up a website I'm working on for a client. I've spent countless hours trying to solve this issue! With my limited knowledge, I could really use some help with the code. The main challenge is making the top section of the site (o ...

Expanding a website banner slide to fill the entire width of the page

Is there a way to ensure that the banner images in the website below flow seamlessly? Currently, it seems like the current image is cut off on the left and part of the previous image shows up in its place. I'd like the current image to occupy the ent ...

The main div on my website appears completely chaotic when viewed in IE versions 7 and 8

On my website, the main div appears floated left on some pages and right on others. In certain pages, it seems to be scattered all over in IE 7 and 8 - I didn't even bother checking in IE6. However, oddly enough, it displays perfectly in IE 6. I need ...

How can the title of a link be hidden in a popup panel?

Seeking assistance for a popup panel issue. When you click on the black ffff button, a popup panel appears with the text ffff having a blue shadow in the top left corner that disappears when clicked. How can I remove this? Here's the link: <a class ...

Extracting data from a dropdown list with beautifulsoup

Could someone please assist me in scraping a list of dates from: The dates can be found within a dropdown menu just above the option chain. I have experience scraping text from websites, but this specific text is utilizing 'select' & 'o ...

Deciding on pixel values, percentages, and sizing elements within CSS styles

For all you web development experts out there, I have a question regarding CSS styles. I often see precise pixel or percentage measurements used for properties like "padding" and "height." Experienced developers seem to effortlessly position their content ...

Issue with Bootstrap carousel: image protrudes past boundaries of parent container

Struggling with setting up a bootstrap carousel on my page. I want the image to extend beyond the parent div, positioned at the bottom rather than the top. How can I achieve this without disrupting the default carousel behavior? Here's a sketch of how ...

Tips for adjusting the font color of user-provided text within an input box using HTML and CSS

HTML code:- <p><input type="text" placeholder="Enter your username"></p> CSS code:- .main-header input { width: 90%; padding: 1rem; margin: 20px 0px; border: none; border-bottom: 4px solid #5f5fb0; ...

The Oracle Apex Login Interface with a Touch of Customized Styling

Currently, I'm working on creating a login page in Oracle APEX. While modifying the icon using CSS code, everything seems to be falling in place except for this one particular line: .t-Login-logo { background-image:url(#APP_FILES#LogoUpdated.jpg); bac ...

Looking for a search box that functions like Google's search feature

I am attempting to create a text box similar to the Google search text box... So far, I have implemented a feature where, upon entering a character, words starting with that character are displayed in a div using AJAX. This functionality is working well, ...

Use jQuery to retrieve the response from a JSON request and showcase it on the existing HTML page

Currently, I am working on a project that involves integrating a JSON-based web service from a remote server. The method of this service can be accessed by using specially formatted URLs such as: http://root-url/ws/service-name?request={json-string} The ...

Altering webpage content through the use of Ajax

I need a solution for dynamically updating web page content using JavaScript AJAX. One idea I had was to store different div layouts in separate files, like so: BasicDiv.div: <div> <p>Some Text</p> <button> A Button </ ...

Turning multiple .html files into a single csv using beautifulsoup

I am dealing with a situation where I have 13,000 html files stored in a folder and my goal is to consolidate all the data into a single csv file. Although I believe I have made progress in extracting the data, I am encountering challenges when it comes t ...

Is there a practical limit for uploading HTML files?

We are currently working on an internal web application and need to find a way to upload a very large file (100mb). Can an HTML file upload handle this size or do we need to consider other options like Java applets, Silverlight, or Flash? Is it even feasi ...