Is it possible to add color to the toggle-off icon in Font Awesome?

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

<i class="fa fa-toggle-off"  style="color:red" ></i>

Currently, I am using the above class and style for the toggle off icon display.

However, I would like it to appear as shown below:

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

Any suggestions on how I can achieve this?

Thank you in advance.

Answer №1

If you're looking for a different icon, consider using fas fa-toggle-on and rotating it 180 degrees for the desired effect. Check out this CodePen example: https://codepen.io/kitchup/pen/yYeMXE

//HTML
<span class="toggle-off">
  <i class="fas fa-toggle-on"></i>  
</span>

//CSS
.toggle-off{
  display: inline-block;
  font-size: 30px;
  color: red;
  transform: rotate(180deg);
}

Answer №2

<span style="color: blue">
    <i class="fa fa-toggle-on"></i>
</span>

It's important to apply a similar method.

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

Ways to modify HTML tag content using Java

Is there a way to update HTML content within a tag using Java? Take the following example: Before: <html> <head> </head> <body> <div>text<div>**text**</div>text</div> </body> & ...

What steps can be taken to add a radio button group to a form in order to choose between the smoking and non-smoking sections of a restaurant?

I'm trying to replicate the functionality of radio buttons within a bootstrap form-group, where a line in a form contains multiple buttons ("btn btn-success" for example) that can be selected, but only one at a time. I am aiming for an output like thi ...

Strange image resizing issues observed during refresh

Every time I refresh the page, I am faced with this strange resizing issue showcased in the GIF below: https://i.sstatic.net/tzlYTUyf.gif The image appears to be resized in an odd manner. <WifiWidgetContainer> <Image ...

CSS grid tracks remain fixed in size while other tracks expand

Why won't the grid track cells dynamically shrink when other cells are enlarged in the following code? In this snippet, hovering over any track section causes that cell to grow to 75% of the viewpoint. However, instead of the other sections shrinking ...

Adjust the baseline of the text within the <li> element by moving it 2 pixels upwards

My webpage menu is set up with inline lis within a ul. Each li has a colored border and contains an a element. I want to change the color of the text inside the a element and move it 2 pixels up when hovering over it without affecting the li border. How ...

Ways to unlock all the information windows in Google Maps

Is it possible to automatically display all info windows on the map when it is first opened, eliminating the need for users to click on markers? In other words, I would like all info windows for all markers to be shown by default when the map is opened. ...

Transfer an HTML file object between two <input type="file"> elements

I am looking to integrate a multi-file uploader into a form that allows users to prioritize the files they upload using draggable and sortable jQuery tools. One way I have added a multi-file input is: <input type = "file" multiple> When I select m ...

I'm having trouble with my fullscreen menu. Is there something I missed when setting it up?

Hi there! I'm currently working on my website and I seem to have run into an issue with the code. I'm still new to coding, so I would appreciate some assistance in identifying where I went wrong. I've been going through the code diligently t ...

Just dipping my toes into Django/Python and feeling completely bewildered by why my webpages won't connect

I'm having trouble with my webpage links. It seems like the file paths are incorrect. I've attempted to link three pages: The homepage The 'artists' icon on the top right of the homepage, linking to 'registerprofessional.html&apo ...

AngularJS ui-select encountering an error - [ui.select:transcluded] Expected 1 ui-select-matchbut found 0

<div class="form-group"> <label class="control-label"> Ticket Closure Type </label> <ui-select ng-model="resCode" theme="bootstrap" ng-click="vm.getClosureTypeOfCloseTicket(resCode)"> <ui-select-cho ...

Determine the closest multiple of 50000 by rounding down the number within the designated input

My input range is behaving strangely. The value starts at 0, but it jumps all the way to 40000 in one direction and -10000 in the other direction. I want it to jump by increments of 50000 - the step indicator is already set to 50000. I believe this issue i ...

Navigating content with style: Horizontal scrolling feature in HTML5 & CSS3

How can I create a magazine-style website similar to asidemag.com using HTML5 and CSS3, with horizontal scrolling feature? ...

Leveraging JavaScript Functions in HTML

I am having an issue with a JavaScript file containing two similar functions that are executed through an HTML form. While the first function runs smoothly, the second function does not display correctly. It seems like I might be calling or executing the ...

The changing of colors does not function properly when clicked in JavaScript

I am having an issue with a drop-down list that offers two options: blue and green. When I select blue and click on the text input field, its background color alternates between blue and black (the default text field color). The same applies when I choose ...

What could be the issue with the Bootstrap dropdown not displaying correctly?

<nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded ...

What is the best way to place division elements next to each other?

Is there a way to align the text "burger king" to the right of the logo on my webpage? I attempted using the bootstrap class pull-left, but it didn't produce any changes. This is how my page appears: body { font-size: 16px; background-color: # ...

I must generate numerous copies of my CSS class using JavaScript

My CSS includes a base class named "toast" that contains basic styling, along with a JavaScript function that generates different types of toasts based on user input. The function modifies the toast class by inserting icons and text as demonstrated below: ...

What could be causing the issues I am encountering while using IE8?

My website looks great on all browsers except for Internet Explorer. I am currently using Internet Explorer 8 to test it. I've tried using a conditional stylesheet (ie.css) to fix some issues, but there are a few problems that have me stumped. I am op ...

Prevent the display of cascading div elements by using JavaScript and jQuery scripting

My webpage performs a simple check to verify if Javascript and cookies are enabled on the client's browser. If they are enabled, the script displays the content inside div id="conteudo" and hides the warning message inside div id="aviso". If not, the ...

Revamp the website's design

I am looking to revamp the color theme of my website with just a click of a button. Can someone provide me with a link to a reference website where I can get some inspiration? ...