Elements overlapping - Form appears on top, yet the cursor slips behind

Having an issue with a form's input field where the text cursor appears behind the input. I've tried adjusting the Z-index but it doesn't seem to be working. How can I bring the cursor to the front? Must be missing something simple, but I just can't figure it out.

Relevant Code:

.searchBox {
  background-color: #7e7e7e;
  border: medium none;
  color: #fff;
  font-family: arial;
  font-size: 12px;
  font-style: italic;
  font-weight: 600;
  height: 24px;
  padding-left: 10px;
  position: absolute;
  width: 38.7%;
  z-index: 3000;
}

.searchIconBox {
  background-color: #7e7e7e;
  height: 24px;
  margin-top: 0;
  padding-left: 5px;
  padding-top: 3px;
  width: 5%;
}
<div style="width:49%;">
  <form style="width:94%;" class="pull-left">
    <input type="text" class="searchBox" placeholder="Search"></input>
  </form>
  <div class="pull-right searchIconBox">
    <asset:image src="search.png" />
  </div>
</div>

Answer №1

The pointer is not disappearing. It is blending in with the shade #7e7e7e

Experiment with changing the color to

.searchBar{
    background-color: orange;
}

when you move the cursor over it, you will notice it becomes visible

Answer №2

Working perfectly for me, but the cursor is not easily visible due to the gray color of the search box.

You could attempt...

.searchBox{background-color:#d0d0d0;}

This change will make your cursor stand out more significantly.

Answer №3

To ensure the cursor starts after the icon in .searchBox, consider increasing the padding-left:

   .searchBox { padding-left: 30px; }

If you want to prevent searchBox from expanding to the right, include box-sizing property:

   .searchBox { padding-left: 30px; box-sizing: border-box; }

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

What is the best way to adjust the size of the close button in react-bootstrap for a unique design?

<CancelButton className="exitBtn"/> .exitBtn{ height:40px; width:35px; } I'm trying to adjust the dimensions of the cancel button, but for some reason it's not working. Can someone provide guidance on how to successfully ...

Automatically adjust height directive to fill up the remaining space

Is there a way to dynamically adjust the height of an element to fill the remaining space within its container? In my current layout, I have a fixed-height header (or menu) in pixels, a content area that may overflow the window height and require scroll b ...

The CSS file that is defined first in the node.js HTML is the only one being utilized

Currently, I am incorporating CSS and JS files into my node.js/express application with the help of the ejs templating engine. Interestingly, while the JavaScript files are being successfully implemented, only the first included CSS file seems to be affect ...

Additional padding was included for the jQuery logo

I've been working on fine-tuning my jQuery submenu, but I'm running into some CSS challenges. Here are the issues I'm facing: How can I prevent the navigation from adding extra padding at the bottom each time it is reopened? .sidebar-n ...

Ways to access the index position

$(function() { $(".menu ul").on("click", "li", function(e) { e.preventDefault(); alert($(this).closest("ul").prev().index()); alert($(this).index()); }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" ...

Triggering an event when selecting options in dropdown menus on Firefox

Currently, I am facing the following scenario: I have a single select box along with a tooltip that is displayed when the user clicks on the box to choose an option. The tooltip can easily be shown using CSS (select:focus ~ .tooltip) or jQuery by utilizin ...

Tips for enabling multiple v-list-group components to remain open simultaneously (bypassing the default Vue behavior)

Currently, I am facing an issue with Vue's default behavior where only one v-list-group can be open at a time. I am using Vuetify 2.6 and have attempted to use the multiple prop without success. Additionally, individually assigning the :value prop to ...

Using JQuery to apply span elements to images

Struggling to create a Pinterest-like webpage using masonry.js? Having trouble appending unique descriptions to each image in your code? You're not alone. The last line of the code seems to be causing issues, but the solution isn't clear. By cons ...

How to activate a media query in response to user interaction using JavaScript

My responsive web page has various designs for different screen sizes, implemented using @media queries. I am interested in allowing users to manually adjust the design for smaller or larger screens without actually changing the screen size. Is there a wa ...

In JavaScript, I'm facing an issue where I can't seem to use ' ' for line breaks for some reason. It's not functioning as expected, and I'm

It seems that I have been struggling with writing a new line in my code using "\n". Despite multiple attempts, the desired outcome has not been achieved. Below is my source code along with a screenshot of the result: var ary3 = new Array('seve ...

What is the best method to disable default inline styles applied by Three.js on canvas element for webpage background?

After successfully creating a scene with three.js, I encountered an issue trying to use it as the background for my page. Unfortunately, I am unable to get the canvas element to move without cutting off half of my page. I have meticulously removed all CSS ...

The correct rendering of React css only occurs after refreshing the IDE

Can anyone assist me with understanding this unexpected behavior in my CSS? I'm struggling to figure out why it's happening and how to correct the CSS imports. In my react app, there is a single component that imports a stylesheet from a separat ...

Is there a way to integrate the javascript and jQuery functions in order to conceal a button?

I recently acquired the File Upload script known as Simple Photo Manager and I am looking to incorporate jQuery functions with the existing JS code in the script. My main goal is to make the Delete button disappear once it has been clicked. However, I am ...

Toggle visibility

Seeking a unique example of a div SHOW / HIDE functionality where multiple divs are populated within the main container. Specifically looking to display new paragraphs or topics of text. I have experience with standard show/hide techniques for collapsing ...

Enable content to be displayed when hovering over it with a mouse in

As a newcomer to JavaScript, I am eager to learn how to add an interactive feature to my menu item. I want to create an info box that pops up when the menu item is clicked, and can also be displayed when hovering over it. Below is the script I have so far, ...

How can the seating arrangement be optimized for a seating chart and what is the most effective way to transition away from a traditional table structure?

Currently, I am attempting to create a dynamic seating chart on a webpage within an asp.net-mvc site using data retrieved from a database. Initially, I used a table to organize the grid layout of rows and columns, which resembled this structure: The datab ...

Bordering the isotopes

Currently, I am utilizing a plugin that involves the isotope filter library. By setting the width to 33.33%, my list elements are organized into 3 columns. I am trying to specify the middle column to have side borders. However, whenever I click on the filt ...

Exploring Selenium with Java: Uncovering the Method to Locate and Identify a Specific Nested Element When Sharing Identical Parent Elements

If I have a page structured like this: <div class = "A"> <h1>AA</h1> <p>This</p> </div> <div class = "A"> <h1>BB</h1> <p>This</p> </div> And each time the page is loaded ...

How can I create a Bootstrap button with a custom href link in my code

I have created a button, is it possible to add an "href" link to this code? My link isn't working! <button class="buttoncostum"> <a href="http://example.com/"><span class="glyphicon glyphicon-th-list" style="color:white" aria-hidden=" ...

Adjusting the vertical alignment of images on a slide show

I've been trying to find a solution for a particular issue I'm facing: The Bootstrap carousel can adjust an image to fit the width of its container, which works well. The problem arises when dealing with images of varying heights. The carousel ...