首页 > 其他分享 >css22 CSS Icons

css22 CSS Icons

时间:2024-05-30 10:12:16浏览次数:23  
标签:icons Awesome Icons HTML css22 Font your CSS

https://www.w3schools.com/css/css_icons.asp

Icons can easily be added to your HTML page, by using an icon library.

 


 

How To Add Icons

The simplest way to add an icon to your HTML page, is with an icon library, such as Font Awesome.

Add the name of the specified icon class to any inline HTML element (like <i> or <span>).

All the icons in the icon libraries below, are scalable vectors that can be customized with CSS (size, color, shadow, etc.)


Font Awesome Icons

To use the Font Awesome icons, go to fontawesome.com, sign in, and get a code to add in the <head> section of your HTML page:

<script src="https://kit.fontawesome.com/yourcode.js" crossorigin="anonymous"></script>

Read more about how to get started with Font Awesome in our Font Awesome 5 tutorial.

Note: No downloading or installation is required!

Example

<!DOCTYPE html>
<html>
<head>
<script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script>
</head>
<body>

<i class="fas fa-cloud"></i>
<i class="fas fa-heart"></i>
<i class="fas fa-car"></i>
<i class="fas fa-file"></i>
<i class="fas fa-bars"></i>

</body>
</html>

Result:

 

For a complete reference of all Font Awesome icons, visit our Icon Reference.



 

Bootstrap Icons

To use the Bootstrap glyphicons, add the following line inside the <head> section of your HTML page:

invalid <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

Note: No downloading or installation is required!

Example

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>

<i class="glyphicon glyphicon-cloud"></i>
<i class="glyphicon glyphicon-remove"></i>
<i class="glyphicon glyphicon-user"></i>
<i class="glyphicon glyphicon-envelope"></i>
<i class="glyphicon glyphicon-thumbs-up"></i>

</body>
</html>

Result:

 

Google Icons

To use the Google icons, add the following line inside the <head> section of your HTML page:

<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

Note: No downloading or installation is required!

Example

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body>

<i class="material-icons">cloud</i>
<i class="material-icons">favorite</i>
<i class="material-icons">attachment</i>
<i class="material-icons">computer</i>
<i class="material-icons">traffic</i>

</body>
</html>

Result:

 

 

For a complete list of all icons, visit our Icon Tutorial.

 

标签:icons,Awesome,Icons,HTML,css22,Font,your,CSS
From: https://www.cnblogs.com/emanlee/p/18221827

相关文章

  • css21 CSS Fonts
    https://www.w3schools.com/css/css_font.asp Choosingtherightfontforyourwebsiteisimportant!FontSelectionisImportantChoosingtherightfonthasahugeimpactonhowthereadersexperienceawebsite.Therightfontcancreateastrongidentity......
  • css20 CSS Text
    https://www.w3schools.com/css/css_text.aspCSShasalotofpropertiesforformattingtext. <!DOCTYPEhtml><html><head><style>div{border:1pxsolidgray;padding:8px;}h1{text-align:center;text-transform:u......
  • css17 CSS Height, Width
    https://www.w3schools.com/css/css_dimension.aspTheCSSheightandwidthpropertiesareusedtosettheheightandwidthofanelement.TheCSSmax-widthpropertyisusedtosetthemaximumwidthofanelement.Thiselementhasaheightof50pixelsand......
  • css18 CSS Box Model
    https://www.w3schools.com/css/css_boxmodel.aspAllHTMLelementscanbeconsideredasboxes.TheCSSBoxModelInCSS,theterm"boxmodel"isusedwhentalkingaboutdesignandlayout.TheCSSboxmodelisessentiallyaboxthatwrapsarounde......
  • css15 CSS Margins
    https://www.w3schools.com/css/css_margin.aspMarginsareusedtocreatespacearoundelements,outsideofanydefinedborders. <!DOCTYPEhtml><html><head><style>div{margin:70px;border:1pxsolid#4CAF50;}</styl......
  • css16 CSS Padding
    https://www.w3schools.com/css/css_padding.aspPaddingisusedtocreatespacearoundanelement'scontent,insideofanydefinedborders. <!DOCTYPEhtml><html><head><style>div{padding:70px;border:1pxsolid#4C......
  • css14 CSS Borders
    https://www.w3schools.com/css/css_border.aspTheCSSborderpropertiesallowyoutospecifythestyle,width,andcolorofanelement'sborder.  CSSBorderStyleTheborder-stylepropertyspecifieswhatkindofbordertodisplay.Thefollowingva......
  • 03 CSS
    一基础选择器1、CSS写在style标签中,可以用选择器{属性名:属性值;}设置 2、插件安装ErrorLens可以帮助判断css是否正确3、CSS引入方式<linkrel="stylesheet"href="./h2.css"/>;行内;头部4、标签选择器使用标签名作为选择器-》选中同名标签设置相同的样式5、类选择......
  • css13 CSS Backgrounds
    https://www.w3schools.com/css/css_background.aspTheCSSbackgroundpropertiesareusedtoaddbackgroundeffectsforelements.Inthesechapters,youwilllearnaboutthefollowingCSSbackgroundproperties:background-colorbackground-imagebackgroun......
  • css12 CSS HEX Colors
    https://www.w3schools.com/css/css_colors_hex.aspAhexadecimalcolorisspecifiedwith:#RRGGBB,wheretheRR(red),GG(green)andBB(blue)hexadecimalintegersspecifythecomponentsofthecolor.HEXValueInCSS,acolorcanbespecifiedusingahex......