Prevent the display of a specified symbol within the <i> </i> tags

I have a button that triggers a dropdown menu. The initial state looks like this:

https://i.sstatic.net/5yhrD.png

When the button is clicked, the + symbol changes to a selected state as shown below:

https://i.sstatic.net/n1Is2.png

How can I remove the selected area from the plus symbol?

Below is my code using Bootstrap:

.custom-container {
  background-color: rgb(31, 182, 255);
  border: 1px solid rgb(31, 182, 255);
  border-radius: 20px;
  height: 40px;
  line-height: 40px;
  margin: 8px;
  text-align: center;
  width: 40px;
}
.custom-dropdown {
  color: rgb(255, 255, 255);
  text-decoration: none;
}
<!-- Bootstrap & jQuery CDN -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<!-- Start of my code -->
<div class="custom-container">
  <a class="dropdown-toggle noselect custom-dropdown" href="#" data-toggle="dropdown" aria-expanded="false">
    <i class="glyphicon glyphicon-plus"></i>
  </a>
  <ul class="dropdown-menu">
    <li><a href="#">Action</a>
    </li>
    <li><a href="#">Another action</a>
    </li>
    <li><a href="#">Something else here</a>
    </li>
    <li class="divider"></li>
    <li><a href="#">Separated link</a>
    </li>
    <li class="divider"></li>
    <li><a href="#">One more separated link</a>
    </li>
  </ul>
</div>
<!-- End of my code -->

Answer №1

It seems that using pseudo css selectors is not allowed, so you will need to target your button from the .css class or possibly a section.

.noselect::selection {
    background: rgba(0,0,0,0); 
}

There may be a more elegant way to achieve this, but this is the first solution that comes to mind.

    .noselect::selection {
        background: rgba(0,0,0,0); 
    }
<p class="noselect">No select</p>

<p>Normal</p>

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 differentiate between words enclosed in quotation marks using colors?

Working on my shop, I've added a section for "Colors available", but now I want to color different words with different colors using Javascript, CSS, or HTML. <button onclick="getColors()">Colors Available</button> <script> ...

Guide to making a slider menu using html, css, and javascript

Just dipping my toes into the world of web development. I'm intrigued by the idea of creating a "slider menu" where users can view and select options by clicking on next or previous buttons (see example image below). While I've got some basic HTM ...

CSS menu with disappearing sub-menu on hover

I'm currently tackling a CSS-only menu project, but I'm struggling with keeping the sub-menu visible when moving away from the li element. The height should span 100% of the page, and the sub-menu should mirror the main menu, appearing to the ri ...

Issue with running `npm start` in React after installing React script version 3.4.0

I'm new to React.js and I've been having trouble getting it to work after using npm start. No matter what I try, I can't seem to get it running. Any help would be appreciated. Error [email protected] start C:\xampp\htdocs& ...

My attempts at creating a column in Bootstrap using push and pull are not successful

My Versatile Code for Different Screen Sizes <div class="col-xs-6 col-lg-2"> <div>A</div> </div> <div class="col-xs-12 col-lg-8 "> <div>B</div> </div> <div class="col-xs-6 col-lg-2"> <di ...

What is causing the issue with the italic font not displaying properly?

I am currently learning CSS. I attempted to make a portion of my text italicized, but for some reason, the text refuses to adopt the desired style. Any ideas on what might be causing this issue? .bold { font-weight: bold; } .italic { font-weight: i ...

Creating elegant Select Dropdown Box in AngularJS without relying on images

I am currently working on an angular page and have implemented a dropdown with ng-Options to fetch and set values successfully. However, I am now looking to enhance the appearance of this dropdown. After exploring options like ui-select, I realized that be ...

Show a plethora of images using the express framework

I have two closely related questions that I am hoping to ask together. Is there a way for express (such as nodejs express) to handle all requests in the same manner, similar to how http treats requests with code like this: pathname = url.parse(request.url ...

I'm puzzled as to why the hidden input field consistently returns the same value every time

As a beginner in php, I am facing an issue where I cannot trace the correct value of the hidden input which represents the ID of the image in the products table. Every time I try to delete an image, it always returns the ID of the last image in the product ...

The CSS3 :nth-child(odd) Selector is not working for either columns or rows in the selection

I am facing an issue with a table where I have used tr:nth-child(odd) to alternate row background colors. HTML /*-----------#602 SAO Styles-----------------------------*/ /*---------SAO Global------------*/ .sao-pricing-table table { border-collaps ...

Hover over a row in one table to modify the appearance of another row in a different table

Is there a way to change the appearance of rows in one table when hovering over rows in another table that are related? You can find a JSFiddle link illustrating what I am trying to achieve. Here is an example of the code: table#table1 #el1:hover + ta ...

Transferring the final space from a node containing a mixture of content to a separate

Having a multitude of HTML files generated by MS Word, my objective is to modify the contents in order to extract data and perform other tasks. In an HTML paragraph with mixed content, I have noticed that spaces after italicized or bold words also become ...

Preventing external HTML code from conflicting with CSS styles

One of the challenges I'm facing on my website is displaying HTML email content. Some of the emails contain CSS that messes up my site layout, causing certain elements to overlap each other. For example, a toolbar at the top of the page might cover i ...

Click-triggered AJAX request encounters failure

I am encountering a strange issue where an ajax call within an on('click') listener triggered by an external click event will fail, but works fine when the listener is activated through a standard user mouse-click. Below is the HTML code snippet ...

Ensure that checkboxes are activated in AngularJS before the ng-model is officially declared

I'm currently working on a web application that utilizes Angular and I'm looking to integrate some checkboxes that are directly linked to database content using ng-repeat. I need an auxiliary array to manage the ng-model, with all checkboxes init ...

How can we incorporate CSS animations into our current elements?

Recently, I created a fun theme for my website (which I will keep undisclosed) featuring CSS3 animations of falling snow. It adds a cute touch to the site. However, I ran into an issue - I wanted the snow animation to appear over my existing items on the p ...

What is the best way to crop an image to focus solely on the center portion?

Using Bootstrap 3, how can I display an image cropped in a .col-sm-6 grid column? The image is 720px wide. Typically, with the .img-responsive class, the image will resize proportionally when the display size changes. However, I want to crop the left and ...

Replace the arrow and implement collapsible div using CSS

My HTML code has the following structure: <ul id="urlcss"> <li class="nav-submenu"> <a class="collapsed" href="#" data-toggle="collapse" data-target="#submenu0"> ...

Align the h1 vertically within a div without any extra space around it

I am trying to vertically center my content div within my header div without any extra space around it. I had it working before but the width of the content div would always be 100%. Here is the code I used: #header { position: absolute; width: 100% ...

The ul element does not encompass all child elements in terms of size

I have been working on creating a tabbed navigation component using HTML, and my code looks like this: <ul class="nav"> <li class="selected">Selected Tab</li> <li><a href="#">Not-selected Tab</a></li> ...