Was sind CSS-Icons?
Symbole liegen in skalierbaren Vektorbibliotheken vor, die mit CSS angepasst werden können
Gängige Bibliotheken sind:
- Schriftart Fantastische Symbole
- Bootstrap-Symbole
- Google-Icons
Wie man?
Um Symbole zu verwenden, fügen Sie einfach einen Link zur Symbolbibliothek im
<head>
Abschnitt Ihrer HTML-Seite hinzu:
Keine Downloads oder Installationen erforderlich!
Um ein Symbol einzufügen, fügen Sie den Namen der Symbolklasse zu einem beliebigen Inline-HTML-Element wie <i>
oder hinzu <span>
.
Font Awesome Beispiel
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<i class="fa fa-cloud"></i>
<i class="fa
fa-heart"></i>
<i class="fa fa-car"></i>
<i class="fa fa-file"></i>
<i class="fa fa-bars"></i>
</body>
</html>
Eine vollständige Liste der Symbole (Font Awesome, Bootstrap und Google) finden Sie in der Symbolreferenz von W3School .
Bootstrap-Beispiel
<!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>
Google-Beispiel
<!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>
Vollständiges Symbol-Tutorial
Dies war eine kurze Beschreibung von Icons.
Ein vollständiges Icons-Tutorial finden Sie unter W3Schools Icons Tutorial .
Eine vollständige Symbolreferenz finden Sie unter W3Schools Symbolreferenz .