不容错过的图标样式-FONT-AWESOME

2024-01-26 16:58

本文主要是介绍不容错过的图标样式-FONT-AWESOME,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

设置Font Awesome字体的方法很简单,只需将两行代码添加到你的网站。或者你可以成为一个专业和定制一个最简单的自己,Bootstrap 3 Font Awesome字体会让更好的扮演自己!

一、最简单的通过MaxCDN方法使用BootstrapCDN

由于在MaxCDN的慷慨的人,您可以使用BootstrapCDN字体的添加到你的网站一行代码。你甚至不需要下载和安装任何东西!

1.将下面的代码粘贴到你站点的HTML部分。

(后立即释放,需要一点时间BootstrapCDN赶上,得到最新的版本CDN生活。)

2.拍拍自己的背你scalable-vector-icons-on-the-website柔道的解决方案在一行代码。

3.查看示例并开始使用Font Awesome字体!

二、简单的默认CSS样式

使用以下方式去获得默认的Font Awesome字体CSS

Copy the entire font-awesome directory into your project.
In the of your html, reference the location to your font-awesome.min.css.

Check out the examples to start using Font Awesome! EASY: LESS Ruby Gem

Use the Official Font Awesome LESS Ruby Gem to easily get Font Awesome LESS into a Rails project. Generously maintained by @supercodepoet.

Add this line to your application’s Gemfile:
gem ‘font-awesome-less’
And then execute:
$ bundle
Or install it yourself as:
$ gem install font-awesome-less
If you use Rails, add this to your e.g. application.less:

@import “font-awesome-sprockets”;
@import “font-awesome”;
EASY: SASS Ruby Gem

Use the Official Font Awesome SASS Ruby Gem to easily get Font Awesome SASS into a Rails or Compass project. Generously maintained by @supercodepoet.

Add this line to your application’s Gemfile:
gem ‘font-awesome-sass’
And then execute:
$ bundle
Or install it yourself as:
$ gem install font-awesome-sass
If you use Rails, add this to your e.g. application.scss:

@import “font-awesome-sprockets”;
@import “font-awesome”;
PRO: Custom LESS or SASS

Use this method to customize Font Awesome 4.3.0 using LESS or SASS.

Copy the font-awesome/ directory into your project.
Open your project’s font-awesome/less/variables.less or font-awesome/scss/_variables.scss and edit the @fa-font-path or $fa-font-path variable to point to your font directory.
@fa-font-path: “…/font”;
The font path is relative from your compiled CSS directory.

Re-compile your LESS or SASS if using a static compiler. Otherwise, you should be good to go.
Check out the examples to start using Font Awesome!
Validators

In order to provide the best possible experience to old and buggy browsers, Font Awesome uses CSS browser hacks in several places to target special CSS to certain browser versions in order to work around bugs in the browsers themselves. These hacks understandably cause CSS validators to complain that they are invalid. In a couple places, we also use bleeding-edge CSS features that aren’t yet fully standardized, but these are used purely for progressive enhancement.

These validation warnings don’t matter in practice since the non-hacky portion of our CSS does fully validate and the hacky portions don’t interfere with the proper functioning of the non-hacky portion, hence why we deliberately ignore these particular warnings.

Need IE7 Support?

If you need IE7 support, you have my condolences. Really. Font Awesome 4.3.0 doesn’t support IE7, but an older version does. You’ll need to check out the 3.2.1 instructions for using IE7. Then go complain to whomever decided your project needs IE7 support.

Troubleshooting

If you’re having trouble with Font Awesome, make sure to check out the troubleshooting wiki page. Generously maintained by @gtagliala.

这篇关于不容错过的图标样式-FONT-AWESOME的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/647461

相关文章

macOS无效Launchpad图标轻松删除的4 种实用方法

《macOS无效Launchpad图标轻松删除的4种实用方法》mac中不在appstore上下载的应用经常在删除后它的图标还残留在launchpad中,并且长按图标也不会出现删除符号,下面解决这个问... 在 MACOS 上,Launchpad(也就是「启动台」)是一个便捷的 App 启动工具。但有时候,应

Python使用PIL库将PNG图片转换为ICO图标的示例代码

《Python使用PIL库将PNG图片转换为ICO图标的示例代码》在软件开发和网站设计中,ICO图标是一种常用的图像格式,特别适用于应用程序图标、网页收藏夹图标等场景,本文将介绍如何使用Python的... 目录引言准备工作代码解析实践操作结果展示结语引言在软件开发和网站设计中,ICO图标是一种常用的图像

HTML5中下拉框<select>标签的属性和样式详解

《HTML5中下拉框<select>标签的属性和样式详解》在HTML5中,下拉框(select标签)作为表单的重要组成部分,为用户提供了一个从预定义选项中选择值的方式,本文将深入探讨select标签的... 在html5中,下拉框(<select>标签)作为表单的重要组成部分,为用户提供了一个从预定义选项中

前端 CSS 动态设置样式::class、:style 等技巧(推荐)

《前端CSS动态设置样式::class、:style等技巧(推荐)》:本文主要介绍了Vue.js中动态绑定类名和内联样式的两种方法:对象语法和数组语法,通过对象语法,可以根据条件动态切换类名或样式;通过数组语法,可以同时绑定多个类名或样式,此外,还可以结合计算属性来生成复杂的类名或样式对象,详细内容请阅读本文,希望能对你有所帮助...

CSS自定义浏览器滚动条样式完整代码

《CSS自定义浏览器滚动条样式完整代码》:本文主要介绍了如何使用CSS自定义浏览器滚动条的样式,包括隐藏滚动条的角落、设置滚动条的基本样式、轨道样式和滑块样式,并提供了完整的CSS代码示例,通过这些技巧,你可以为你的网站添加个性化的滚动条样式,从而提升用户体验,详细内容请阅读本文,希望能对你有所帮助...

vue解决子组件样式覆盖问题scoped deep

《vue解决子组件样式覆盖问题scopeddeep》文章主要介绍了在Vue项目中处理全局样式和局部样式的方法,包括使用scoped属性和深度选择器(/deep/)来覆盖子组件的样式,作者建议所有组件... 目录前言scoped分析deep分析使用总结所有组件必须加scoped父组件覆盖子组件使用deep前言

macOS怎么轻松更换App图标? Mac电脑图标更换指南

《macOS怎么轻松更换App图标?Mac电脑图标更换指南》想要给你的Mac电脑按照自己的喜好来更换App图标?其实非常简单,只需要两步就能搞定,下面我来详细讲解一下... 虽然 MACOS 的个性化定制选项已经「缩水」,不如早期版本那么丰富,www.chinasem.cn但我们仍然可以按照自己的喜好来更换

[环境配置]ubuntu20.04安装后wifi有图标但是搜不到热点解决方法

最近刚入手一台主机,暗影精灵8plus电竞主机,安装ubuntu后wifi怎么都搜不到热点,前后重装系统6次才算解决问题。这个心酸历程只有搞技术人才明白。下面介绍我解决过程。 首先主机到手后是个windows10系统,我用无线网连接了一下,可以正常上网,说明主机有无限网卡且正常。然后我就直接开始安装Ubuntu20.04了,安装成功后发现wifi有图标但是搜不到热点,我想是不是无线网卡驱动有没有

在项目开发中,jsp页面不会少了,如何公用页面(添加页面和修改页面)和公用样式代码(css,js)?

在项目开发中,如何公用添加页面和修改页面? <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><html><head><title>岗位设置</title><%@ include file="/WEB-INF/jsp/public/common.jspf"%></head><body> <!-- 标

CAD 多个页面在一个任务栏图标设置

命令行输入快捷键op或: 下图打对号,确定即可。