Field cannot have text selected or highlighted in Form

I've encountered a strange issue where I can't seem to select or highlight text in my form fields.

Despite everything else appearing to work correctly, this particular problem has me stumped.

I've tried on both Chrome and Safari, but highlighting text just doesn't seem to work at all.

{
  position:relative;
  width:100%;
  margin-bottom:-20px;
}
            
.outerForm img {
  width:800px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
            
form {
  display: table;
  position:absolute;
  top:0px;
  left:0px;
  right:0px;
  margin-left: auto;
  margin-right: auto;
  color:black;
  width:600px;;
  height:300px;
  margin-top: 100px;
}            
            
.innerForm > input, .innerForm > label {
  display: inline-block;
  vertical-align: top;
  margin-left: 5px;
  margin-top: 25px;
  margin-right: 5px;                
}
            
.innerForm > label {
  width:70px;
  text-align: left;
}
            
#messageLabel {

}            
            
input[type="text"] {
  width:200px;
  height:30px;
  border:none;
  outline:none;
  box-shadow: none;
  background-color:transparent;
  border-bottom: 1px solid black;
}
            
textarea {
  resize: vertical;
  width:85%;
  border:none;
  outline:none;
  box-shadow: none;
  background-color: transparent;
  padding-bottom: 18%;
  border-bottom: 1px solid black;
  margin-top: 20px;
}
            
textarea:focus {
  border:none;
  outline:none;
  background-color: transparent;
  box-shadow: none;
  border-bottom: 1px solid red;
}
            
.innerForm > h4 {
  margin-bottom:-10px;
  text-transform:none;
  font-family: 'Novecento sans wide';
}
        
input[type="text"]:focus, input[type="textarea"] {
  border:none;
  outline:none;
  background-color:transparent;
  box-shadow: none;
  border-bottom:1px solid red;
}
        
#submitBtn {
  background-color:transparent;
  color:black;
  font-weight:400;
  border:none;
  outline:none;
  border:2px solid white;
  padding:10px 20px 10px 20px;
  font-size: 15px;
  margin-top:15px;
  transition: all 0.5s ease;
}
        
#submitBtn:hover {
  background-color: #0080ff;
  color:white;
}
<div class="outerForm">
  <img id="cardImage" class="img-responsive" src="PlayingCardTemplate.png"/>
  <form id="contactForm" action="Contact.php" method="POST">
    <div class="innerForm">
      <h4>Arshdeep Soni</h4>
      <label id="nameLabel" for="name">Name:</label>
      <input id="name" name="name" type="text"/>
      <label id="phoneLabel" for="phone">Phone:</label>
      <input id="phone" name="phone" type="text"/>
      <label id="emailLabel" for="email">Email:</label>
      <input id="email" name="email" type="text"/>
      <label id="occasionLabel" for="occasion">Occasion:</label>
      <input id="occasion" type="text" name="occasion"/>
      <label id="messageLabel" for="message">Message:</label>
      <textarea id="message" name="message" ></textarea>
      <input type="submit" value="Submit" id="submitBtn" name="submit"/>
    </div>
    <p id="feedback"></p>
  </form>
</div>

Answer №1

To address the issue, check for the presence of ::selection in your CSS Stylesheet. It's possible that an imported stylesheet or theme may have included

::selection{background:transparent
for various reasons. By locating and modifying this class, you can resolve the problem. Additionally, you can utilize color: to change the text color within your selection.

For Mozilla browsers, use ::-moz-selection

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

Flexbox presenting a specific alignment issue

I'm facing a challenge using Flexbox to achieve the desired result shown below https://i.sstatic.net/8vJGQ.png When trying to position my 2 blocks on the right, one of them ends up crossing the line and I struggle to bring it back up. I want this l ...

Text color animation effect for menu

Here is the layout of my menu: <nav> <a href="#"> <span class="black">Home</span> <span class="red active">Home</span> </a> <a href="#"> <span class="black">Longer m ...

Using a combination of jQuery and JavaScript to switch image tags between different classes

I'm really struggling with this issue and could use some guidance. Essentially, I have a code that should change the class of an img tag when a user clicks on a div element. Let's take a look at the HTML structure: <li><img src ...

Left-align elements within a div container that is centered

I want to left-align my elements within a div container that is centered. I used the text-align property to center the overall div, but now I'm having trouble aligning another content container's text to the left within the center-aligned div. H ...

What is the method for altering the track color on a range slider?

Struggling to change the track color of a range slider using CSS in Chrome? Look no further, as I found a solution using jQuery (link). However, after implementing the solution, the expected output is not achieved. jQuery: $('.text-size-slider .slid ...

Using jQuery to swap out intricate background designs

I'm attempting to use jQuery to change the background-color of an element from: background: transparent linear-gradient(#C0B 45%, #C0B) to: background-color:#000; Unfortunately, my attempt to remove the background property with .removeAttr() has n ...

Guide to creating a versatile navigation bar using Bootstrap and HTML

I am looking to create a navigation menu that can be easily reused across multiple pages on my bootstrap/html website. Instead of duplicating code, I want to implement a solution for creating a reusable navigation menu in bootstrap/html. How can this be ...

What is the new Bootstrap equivalent for btn-group-justify?

Could someone help me align the 3 radio options in this HTML code to make them appear justified? I have already tried using d-flex and btn-group-justify without success. If anyone could provide a sample using only Bootstrap 4.1+, it would be greatly appre ...

Numerous options available in a dropdown menu

I have a Dropdown menu that offers various functions. "Update" option redirects to a page for updating information "Export Form" option redirects to a page for exporting the form Although the current code allows these actions, I am facing an issue with ...

Arranging a child element within a parent element by placing the child div on the right side of the parent div

I am struggling with positioning a child .div containing rotating images to the right side of its parent (header) .div. I am utilizing the flexbox model for layout purposes. Despite my efforts, the solutions I have come across so far have not yielded the ...

Place one flex item in the center and align another item to the bottom

I am attempting to center one flex item both vertically and horizontally. At the same time, I want some text to remain fixed at the bottom of the flex container. When I use margin-top:auto on the text, it just moves the inner box to the top. Any suggesti ...

Having trouble viewing a dynamically adjusting Angular NVD3 graph embedded in bootstrap

I have been utilizing the NVD3 library along with bootstrap 3.0 for my project. I have two divs with the classes "col-md-6 col-sm-12" positioned side by side. My goal is to showcase charts in both of these divs. To ensure that the charts are displayed corr ...

Conditionals causing issue with React Button disabled property functionality

Having a DIV with two child elements, namely buttons that should be disabled under certain conditions. Despite correct conditions being applied, the buttons remain enabled which is causing confusion. The code snippet in question is as below : < di ...

Mapping the Way: Innovative Controls for Navigation

Currently, I am utilizing the HERE maps API for JavaScript. However, I would like to customize the design of the map controls similar to this: Below is an example for reference: HERE EXAMPLE Is it feasible to achieve this customization? ...

What is the best way to maintain the value of variables across different HTML files?

Imagine having a scenario where a page is connected to a .js file. This file contains code that assigns a value to a variable like this: var foo; function bar() { foo = //value generated through user input } bar(); Now the goal is to move t ...

Creating an interactive website by utilizing fundamental HTML/CSS along with PHP or WordPress

I need to create a customized website for my project, which should include an admin dashboard for the site owner to modify specific visual components as needed. My main concern is whether I should rely solely on core PHP, HTML, and CSS for this task. Ca ...

Obtain user input and showcase it on the screen using a combination of Ajax and PHP

Whenever a user inputs a value in the textbox, it should dynamically display on the screen. I have successfully implemented this feature once, but I am encountering difficulties with implementing it for a second input. Your help is greatly appreciated. fu ...

The SpringMvc tiles are failing to display the header and footer

One of the main components in my project is a file called tiles.xml <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN" "http://tiles.apa ...

The search function on my blog is not displaying the blogs that have been filtered

I have encountered an issue with my code as I am unable to get any search results from the search bar. const RecentBlogs = ({recentBlogs}) => { const [query, setQuery] = useState("") const filteredItems = (() => { if(!query) return rec ...

CSS prefers to remain within its original controller and does not want to be uploaded from any other source

My webpage includes headers and footers with CSS in them. Strangely, when I load the view using one controller, the CSS displays correctly. But when I try to load the same view using a different controller, the CSS doesn't appear at all. What could b ...