Tips for modifying the symbol (character) of an iconmoon font using CSS techniques

I need help finding a solution for this question, forgive me if it seems silly. I have a button with a search symbol (iconmoon font) and I want to change the search symbol when hovering over it.

HTML:

<button class="share search-btn"><span class="icon-icn_search"></span></button>
CSS:

@font-face {
    font-family: 'icomoon';
    src:    url('../fonts/icomoon.eot');
    src:    url('fonts/icomoon.eot') format('embedded-opentype'),
        url('fonts/icomoon.ttf?m23m4l') format('truetype'),
        url('fonts/icomoon.woff?m23m4l') format('woff'),
        url('fonts/icomoon.svg?m23m4l#icomoon') format('svg');
    font-weight: normal;
    font-style: normal;
}

.mls {
    font-family: 'icomoon' !important;
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    color: #ffffff;
    font-size: 28px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.icon-icn_search:before {
   content: "\e934";
}
.icon-icn_question_small_hover:before {
   content: "\e932";
}
.search-btn {
   background-color: #6670a7;
   padding: 15px 10px 15px 10px;
}
.search-btn:hover{
   background-color: #434f93;
}
.search-btn:hover:before{
   content: "/e932";
}

Thank you!

Answer №1

If you're looking for a solution, try this out:

Try eliminating the following:

.search-btn:hover:before{
  content: "\e932";
}

Instead, insert this:

.search-btn:hover .icon-icn_search:before{
   content: "\e932";
}

Answer №2

.search-button .icon-search:before {
   content: "\e934";
}

.search-button:hover .icon-search:before {
   content: "...";
}

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

Creating an organized layout with multiple bootstrap toasts in a grid formation

Is there a way to create multiple Bootstrap Toast elements side-by-side and top-to-top? For more information, visit: https://getbootstrap.com/docs/4.2/components/toasts/ <div aria-live="polite" aria-atomic="true" style="position: relative; min-height: ...

Create a personalized attribute for division automation

Is it possible to automatically divide a dynamically populated ListView in jQuery-mobile into two groups based on the attribute values (Downloaded/Not downloaded)? Some listitems have the attribute status="true" while others have status="false". Here is t ...

What is the best way to set the z-index for elements within CSS containers that are utilized for container queries?

I am thrilled about the introduction of container queries in CSS. It's great to see this feature now available across all browsers. However, I have encountered an issue when working with multiple consecutive containers and placing an absolutely positi ...

Can beautifulsoup handle scraping a "dynamic webpage"?

I am exploring the use of beautifulsoup for web scraping, despite my lack of theoretical knowledge about webpages. I believe I have grasped the basics and will try my best to articulate my question. By a dynamic webpage, I mean a site that changes its HTM ...

How can I personalize the navigation buttons and indicators of the "react-owl-carousel" component in my React project with CSS or JavaScript?

I've been working on customizing the navigation arrows and dots for the React Owl Carousel npm package using CSS or JS for quite some time now, but have not been successful. I am determined to avoid using jQuery in this project. https://i.sstatic.net ...

Error 404: CSS3 file not found - - utilizing Node.JS and EJS

While it may appear similar to previous inquiries, I have explored other solutions without success. Below is my code snippet: NodeJs: var express = require("express"), app = express(), mongoose = require("mongoose"); mongoose.connect("mongod ...

Toggle css comment line using gulp

Is it possible to temporarily deactivate a particular CSS comment on a specific line using Gulp and then reactivate it after completing a build task? As an illustration, I am interested in deactivating the @import 'compass/reset'; statement loca ...

Pixel information from previous canvas remains intact post resizing

I have crafted a canvas and loaded pixel data at specific locations using the following code snippet. let maskCanvas = document.createElement("canvas"); let patchWidth = 30; let patchHeight = 30; let scale = 3; maskCanvas.setAttribute("class", "mask"); ...

Swapping out data points using JQuery

What could be causing line 10 to return null? Click here for the code file The code seems to function properly with line 40, but not with line 10. ...

Issues with Css custom properties on certain webhosting platforms

Seeking assistance with a CSS custom properties issue. Recently purchased a web hosting service from Hostinger and using the default Wordpress template. Our web designer created a website in teleporthq.io, exported the files as HTML and CSS. Deleted the ...

Ways to achieve varying border widths among multiple divs that are linked to text size

Hey there, I'm looking to make some changes to the UI of my game. I want to transform it from this: https://i.sstatic.net/iLpFY.jpg To this (which is an edited version using paint.net of the previous image): https://i.sstatic.net/qudVm.jpg <html& ...

input access is granted through the post method using an integer as the name parameter

Suppose there is a dynamic form with multiple fields generated with integer names based on the iteration that creates them. The goal is to retrieve their values using either post or get method (though focusing on post here). Below is the code for generati ...

Cut off text in a dropdown button using Bootstrap 4

I'm encountering an issue with a dropdown button where the text is a combination of a fixed part and a variable part from a database. The variable text can be long, so I need to truncate it. In order to apply bootstrap's .text-truncate class (or ...

How can I swiftly load or insert HTML code into an HTML file using jQuery?

I'm currently developing a mobile app using Cordova, essentially an html-based application running in an app wrapper. I have numerous elements and html code that need to be consistent across all pages, such as navigation menus, popups, and more. When ...

Storing information from a table into LocalStorage

$('.new_customer').click(function () { var table = $("table"); var number = table.find('tr').length; table.append('<tr id="' + number + '"><td><input type="button" class="btn btn-success btn-xs" ...

Can a file be loaded using JS/HTML5 FileReader on a page that is not being served?

I am looking to create a simple game using HTML5/JS without requiring the user to run a webserver or connect to a website. I only want them to access an HTML page. However, it seems like FileReader can only be used with file type inputs. Is there a way f ...

Encountering a Javascript Error when trying to begin

As a beginner in Javascript, I am venturing into designing a simple website that incorporates Javascript. Currently, my focus is on building a calculator. However, upon loading my website, nothing seems to initiate and there are no error messages displayed ...

Retrieve the input value closest to the selected row

I need to extract the price and currency value of a checked row containing a checkbox. The price is specified in a text box while the currency is selected from a dropdown menu. $(document).ready(function() { $('#test').click(function(){ ...

Tips for eliminating the pesky "ghost" line that appears in your coded HTML email

Check out this Sample Code: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> <head> <title></title> & ...

Tracking mouse positions across an HTML document

I've been working on a project inspired by the voxel painter example on the three.js page. In this particular example, the mouse coordinates are utilized to move a roll-over helper that indicates where a box will be placed upon click. mouse.set((even ...