Icon displayed on separate line

I'm currently working on displaying FontAwesome icons with the category names on WooCommerce WordPress products. While I've managed to get them to show on a separate page, I'm encountering an issue when trying to display them in the mega menu (Tweezers By Category). The problem is that the FA icons are appearing on a new line instead of before the name. You can see the live link here. If anyone out there could assist me with this, I would greatly appreciate it.

Answer №1

To properly add the icon, place it inside each <li> element like this:

<li style="float:left;">
    <a href="http://newsite.cealinetweezers.com/tweezers/tweezers-by-category/aquarium-aquascaping-tweezers/">
        <i class="fa fa-dropbox"></i> 
        Aquarium &amp; Aquascaping Tweezers
    </a>
</li>

Avoid wrapping the icon with a span and floating it outside of the li - that approach is not recommended.

Answer №2

Using the span tag as a solution.

<li style="float:left;">
<a href="http://newsite.cealinetweezers.com/tweezers/tweezers-by-category/aquarium-aquascaping-tweezers/"><i class="fa fa-dropbox"></i> Discover Aquarium &amp; Aquascaping Tweezers Here!</a></li>

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

Looking for a way to ensure a div reaches 100% height within a specified area without exceeding the boundaries of the body?

I am working with jQuery mobile and have specific requirements for my project: The main content will be a large graphic that needs to fill the entire page, with both horizontal and vertical scrolling if necessary. The header should remain fixed at the to ...

How can I divide a div by utilizing word wrap?

My CSS-styled div is pretty straightforward .text { text-transform: capitalize; color: #FFFFFF; background: #918a8a; opacity: 0.6; font-size: 2em; height: 80px; width: 200px; } It creates a grey box w ...

Ensure that the width of the sibling div matches the width of its sibling image

I need help displaying an image with two buttons positioned below it. The dimensions of the image can vary, so I've set a max-width of 60% and max-height of 80%. However, I'm struggling to align the buttons correctly under the image - with the le ...

Issues with hidden overflow and height attributes not functioning correctly in Internet Explorer 9 when using the DOCTYPE HTML standards mode

I have a <div> with overflow:hidden and height:100% that adjusts the div contents to fit the window's height on Chrome and Safari. However, in IE9, the div does not respect the styles of overflow:hidden and height:100%, causing it to expand to ...

Unable to render JSON data using AJAX

I have a JSON file filled with various data and I'm trying to use AJAX to display it. Despite my efforts, I couldn't get it to work and after extensive research online, I decided to reach out for your assistance: $(document).ready(function ...

Calculating the total number of days in each month within a specified date range using PHP in a dynamic way

Thank you for taking the time to help me with my issue. For instance, if a user selects a date range from 10 Dec 2016 to 20 April, how can I calculate the number of days for each month within that range? For example, Dec=22 Days, Jan=31 Days, Feb=28 Days, ...

Refusing to include two values due to the presence of a comma in JavaScript

I'm trying to add two values with commas and .00 (Example: 1,200.23 + 2,500.44) but it's not working because the textbox includes commas as required by my system. The result shows NaN because the comma is considered a special character. It was w ...

Tips for incorporating Material.io outlined icons within css pseudoelements (::before) usage

I'm attempting to incorporate the Material.io icon into a button using ::before, but it is appearing filled rather than outlined. Unfortunately, there are no available instructions on how to display the icon in an outlined style. This is the code I ...

Django's background image remains static regardless of CSS changes

I recently downloaded an HTML template and am attempting to customize it by changing the background image within the CSS file. The current code in the CSS file is as follows: background: url(../img/background.jpg) Despite my efforts to replace it with t ...

What is the best way to remove the bullets adjacent to my Twitter feed?

Greetings! I am currently working on a homepage with a Twitter feed, but I am struggling to remove the bullets. Despite my efforts to find the correct CSS code (inputting "list-style-type: none;"), I have been unsuccessful. I've spent quite some time ...

We have come across a project on CodePen that utilizes Three.js, and we are looking to customize its color scheme

We stumbled upon a fascinating blob experiment on Codepen (https://codepen.io/vcomics/pen/ZwNgvX) and were eager to incorporate it into our project. However, we encountered an issue with the color changing feature on this perlin object (rcolor, gcolor, bco ...

Using Webpack to set up CSS aliases: Step-by-step guide

Utilizing Webpack allows us to establish resolve aliases and integrate them within our CSS stylesheets. resolve: { extensions: ['.js', '.vue', '.json', '.scss', '.css'], alias: { 'fonts& ...

Java and Selenium: Struggling to Find Element based on Attribute

Attempting to click a button on a webpage with the given HTML code: <html lang="en" webdriver="true"> <head> <body class="scbody" style="background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAKCAYAAAB10jRKAAAAGXRFWHRTb2 ...

What is the best technique to incorporate dark/light mode in Bootstrap 5?

Is it best to introduce themes such as dark and light themes in Bootstrap 5 using CSS/SCSS, JavaScript, or a combination of both? Should we create a separate CSS file like dark.css to overwrite classes? Or should we use JavaScript to switch classes like ...

incorporating a rollover menu into the images displayed on the webpage

I have a set of 3 images displayed inline, each enclosed in a span tag with the class imgAvatar. Positioned above them are 3 identical hidden images (delete buttons) stored within spans with the class imgAvatarSelector. The CSS for the delete buttons is a ...

Issues with the last-child selector in CSS being unresponsive

I am having trouble applying styles to the final <p> in a specific div. I would like to achieve this without introducing a new class or ID. Despite attempting to use the last-child selector, I have not been successful in accomplishing my goal. I ha ...

Content within a Row of a Data Table

Hello! I am just starting to learn JavaScript and jQuery. Can you help me with an issue I am experiencing? Basically, I have a table and I need to identify which tr contains a td with the text "Weekly", "Daily", or "Monthly". Once I locate that specific t ...

Achieving a Full-Screen Three.js Canvas in React: A step-by-step guide on spanning the view height and width of a webpage

I've been working on tweaking the code found in this particular example: How to connect Threejs to React? This is the snippet of code I am focusing on: import React, { Component } from 'react' import * as THREE from 'three' clas ...

"Difficulties with Tribute Page Project on FreeCodeCamp: HTML and

I am currently working on a tribute page for a challenge from FCC and I am facing some issues with adding padding to my .life and .work divs in the HTML and CSS code above. Despite spending a few hours searching for solutions online, I have not been able ...

What is the purpose of the asterisk symbol in CSS?

Can you explain the purpose of the star symbol in CSS and what it is commonly referred to as? I see it as a type of wild card, but I would like to research it further. #div { *zoom: 1; /*this ... * zoom : 1; display: inline; *display: inline; /*. ...