font-awesome

How to change color of font-awesome icon by clicking the icon

最后都变了- 提交于 2021-02-07 20:22:01
问题 var garbage = document.getElementById("garbage"); garbage.addEventListener("click",function(){ garbage.style.color = "#66c144"; } <link href="https://use.fontawesome.com/releases/v5.0.10/css/all.css" rel="stylesheet"> <div id="garbage"> <i class="fas fa-trash"></i> </div> Hi, I am trying to change the font color for font-awesome trash icon by clicking the icon. However, it is not working. I would appreciate any tips on how to get this work. var trash = document.getElementById("trash"), glass

How to change color of font-awesome icon by clicking the icon

别说谁变了你拦得住时间么 提交于 2021-02-07 20:20:55
问题 var garbage = document.getElementById("garbage"); garbage.addEventListener("click",function(){ garbage.style.color = "#66c144"; } <link href="https://use.fontawesome.com/releases/v5.0.10/css/all.css" rel="stylesheet"> <div id="garbage"> <i class="fas fa-trash"></i> </div> Hi, I am trying to change the font color for font-awesome trash icon by clicking the icon. However, it is not working. I would appreciate any tips on how to get this work. var trash = document.getElementById("trash"), glass

Rails assets Cloudfront fontawesome CORS

只谈情不闲聊 提交于 2021-02-07 12:16:36
问题 I tried a lot of solutions found on stackoverflow/github for this issue but I can't get it to work. I'm using font-awesome-rails and I precompile my assets for production. I've set CloudFront for my assets in my production config: config.action_controller.asset_host = "https://XXXX.cloudfront.net" When I load a page (from Chrome/Firefox because Safari is OK with CORS) I get this common error message : Font from origin 'https://XXXX.cloudfront.net' has been blocked from loading by Cross-Origin

Rails assets Cloudfront fontawesome CORS

百般思念 提交于 2021-02-07 12:14:37
问题 I tried a lot of solutions found on stackoverflow/github for this issue but I can't get it to work. I'm using font-awesome-rails and I precompile my assets for production. I've set CloudFront for my assets in my production config: config.action_controller.asset_host = "https://XXXX.cloudfront.net" When I load a page (from Chrome/Firefox because Safari is OK with CORS) I get this common error message : Font from origin 'https://XXXX.cloudfront.net' has been blocked from loading by Cross-Origin

Use font-awesome in a Vue app created with vue-cli webpack

强颜欢笑 提交于 2021-02-07 05:07:13
问题 I'm trying to use the font-awesome in a simple Vue app created with vue-cli using the webpack-simple template, but this is being tricky. I installed font-awesome using npm install font-awesome --save and imported it in my entry js (main.js) import Vue from 'vue' import App from './App.vue' import VueRouter from 'vue-router'; import Home from "./components/Home.vue" Vue.use(VueRouter); import 'font-awesome/css/font-awesome.css'; const routes = [ { path: '/', component: Home } ]; const router =

Use font-awesome in a Vue app created with vue-cli webpack

两盒软妹~` 提交于 2021-02-07 05:05:50
问题 I'm trying to use the font-awesome in a simple Vue app created with vue-cli using the webpack-simple template, but this is being tricky. I installed font-awesome using npm install font-awesome --save and imported it in my entry js (main.js) import Vue from 'vue' import App from './App.vue' import VueRouter from 'vue-router'; import Home from "./components/Home.vue" Vue.use(VueRouter); import 'font-awesome/css/font-awesome.css'; const routes = [ { path: '/', component: Home } ]; const router =

Font awesome 4 and 5 in same page

点点圈 提交于 2021-02-06 21:40:49
问题 I have a conflict with font awesome when 2 different css versions are used. I am not trying to use 2 different version, but my plugin embeds one version and sometimes a wordpress website has another version. I am interested in this particular example, why doesnt first icon display if they both have same :before content? (I have noticed it works if fa5 is linked first in the page) What would be the easiest solution to handle this? <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0

Font awesome 4 and 5 in same page

。_饼干妹妹 提交于 2021-02-06 21:37:31
问题 I have a conflict with font awesome when 2 different css versions are used. I am not trying to use 2 different version, but my plugin embeds one version and sometimes a wordpress website has another version. I am interested in this particular example, why doesnt first icon display if they both have same :before content? (I have noticed it works if fa5 is linked first in the page) What would be the easiest solution to handle this? <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0

Font awesome 4 and 5 in same page

为君一笑 提交于 2021-02-06 21:36:51
问题 I have a conflict with font awesome when 2 different css versions are used. I am not trying to use 2 different version, but my plugin embeds one version and sometimes a wordpress website has another version. I am interested in this particular example, why doesnt first icon display if they both have same :before content? (I have noticed it works if fa5 is linked first in the page) What would be the easiest solution to handle this? <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0

Make Font Awesome icons in a circle border with right 1:1 ratio

自作多情 提交于 2021-02-05 07:36:38
问题 In some case, if the ratio of the icon is not 1:1, the border is not a circle anymore. Here's an example: I'm currently using: HTML: .socials a(href='#') <i class="fa fa-facebook"></i> a(href='#') <i class="fa fa-twitter"></i> a(href='#') <i class="fa fa-google"></i> SASS: border-radius: 50% border: solid white padding: 10px Is there anyway that I can use CSS to fix the problem? 回答1: You need to set width, height, line height, & text-align to center the icon. icon will need also vertical