W3.CSS 图标

创建于 2024-12-03 / 26
字体: [默认] [大] [更大]


图标库

有了W3.CSS你可以使用你喜欢的图标库,比如:

  • Font Awesome 字体图标
  • Google Material Design 图标
  • Bootstrap 图标

使用图标库

插入图标:

  1. 在 <head> 部分中包含来自 CDN(内容分发网络)的图标库。
  2. 将图标类的名称添加到任何内联 HTML 元素。

提示: <i> 和 <span> 元素广泛用于添加图标。

要控制图标的大小,更改图标的 font-size 属性,或使用 w3-size 类之一:

  • w3-tiny
  • w3-small
  • w3-large
  • w3-xxlarge
  • w3-xxxlarge
  • w3-jumbo

一些 Font Awesome 字体图标


fa fa-home
fa fa-bars
fa fa-arrow-left
fa fa-arrow-right
fa fa-search
fa fa-close
fa fa-refresh
fa fa-trash
fa fa-male
fa fa-car
fa fa-truck
fa fa-plane

实例

<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3ccoo.com/w3css/4/w3.css">
<link rel="stylesheet" href="/cdnjs/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<body>

<i class="fa fa-home"></i>
<i class="fa fa-search"></i>
<i class="fa fa-cloud"></i>
<i class="fa fa-trash"></i>

</body>
</html> 亲自试一试 »

如需完整的图标列表:访问我们的图标参考


一些 Google Material Design 图标

home
home menu
menu arrow_back
arrow_back arrow_forward
arrow_forward search
search close
close refresh
refresh delete
delete person
person directions_car
directions_car local_shipping
local_shipping local_airport
local_airport

实例

<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3ccoo.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<body>

<i class="material-icons">home</i>
<i class="material-icons">search</i>
<i class="material-icons">cloud</i>
<i class="material-icons">delete</i>

</body>
</html> 亲自试一试 »

一些 Bootstrap 图标


home
menu-hamburger
arrow_back
arrow_forward

search
remove
refresh
trash

user
file
print
plane

实例

<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3ccoo.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://www.w3ccoo.com/lib/bootstrap/3.3.6/css/bootstrap.min.css">
<body>

<i class="glyphicon glyphicon-home"></i>
<i class="glyphicon glyphicon-search"></i>
<i class="glyphicon glyphicon-cloud"></i>
<i class="glyphicon glyphicon-trash"></i>

</body>
</html> 亲自试一试 »

0 人点赞过