Font references and transition effects outside the system

Font references and transition effects outside the system

Copy code
The code is as follows:

<span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-size:14px;">1. External font reference: use font-face to introduce fonts</span></span>


Sometimes, we need to use some fonts that are not in the system. We may need to reference the fonts we downloaded from the outside. The method is:

Copy code
The code is as follows:

<!DOCTYPE html>
<html>
<head>
<title>Font Reference</title>
<meta charset="utf-8">
<style type="text/css">
<span style="white-space:pre"> </span>/*Use @font-face to introduce fonts*/
@font-face{
font-family: heeh;
/*The following three forms are all possible*/
/*src:url("Sansation_Light.ttf");*/
/*src:url('简娃娃篆.ttf');*/
src:url(Fangzheng Fat Baby Simplified.ttf);
}
.tb{
font-size: 80px;
color: #f40;
font-weight: 300;
<span style="white-space:pre"> </span><span style="white-space:pre"> </span>/*Declare the name of the referenced font here*/
font-family: heeh;
}
</style>
</head>
<body>
<h1 class="tb">Taobao</h1>
</body>
</html>


2. Transition effect: attribute is transition

When the mouse moves to a certain area, a transition effect occurs before the effect is achieved. like

Copy code
The code is as follows:

<!DOCTYPE html>
<html>
<head>
<title>transiton</title>
<meta charset="utf-8">
<style type="text/css">
.div_tran{
width: 130px;
height: 100px;
/*a in rgba is transparency (range 0~1)*/
background: rgba(165,237,15,0.5);
/*background: rgb(165,237,15);*/
/*css transparency property opacity (range 0~1)*/
opacity: .3;
color: #000;
<span style="white-space:pre"> </span>/*This comment and the following sentence are both acceptable*/
/*-webkit-transition:width 2s,height 3s,background,opacity 2.5s; */
-webkit-transition:all 3s;
}
.div_tran:hover{
width: 200px;
height: 200px;
background: rgb(28,227,209);
opacity: 1;
color: red;
}
/* span{
opacity: 1;
position: relative;
top: -100px;
}*/
</style>
</head>
<body>
<div class="div_tran">
transiton
</div>
<!-- <span>transiton</span> -->
</body>
</html>

<<:  Detailed explanation of the marquee attribute in HTML

>>:  Detailed explanation of JavaScript Proxy object

Recommend

What is a MySQL tablespace?

The topic I want to share with you today is: &quo...

MySQL complete collapse: detailed explanation of query filter conditions

Overview In actual business scenario applications...

Building a KVM virtualization platform on CentOS7 (three ways)

KVM stands for Kernel-based Virtual Machine, whic...

Detailed explanation of Angular structural directive modules and styles

Table of contents 1. Structural instructions Modu...

JS implements user registration interface function

This article example shares the specific code of ...

Vite+Electron to quickly build VUE3 desktop applications

Table of contents 1. Introduction 2. Create a Vit...

Detailed explanation based on event bubbling, event capture and event delegation

Event bubbling, event capturing, and event delega...

The most convenient way to build a Zookeeper server in history (recommended)

What is ZooKeeper ZooKeeper is a top-level projec...

Detailed tutorial on installing MySQL 8.0 from source code on CentOS 7.4

Table of contents 1. Environment 2. Preparation 3...

Introduction to TypeScript interfaces

Table of contents 1. Interface definition 2. Attr...

mysql 8.0.16 winx64.zip installation and configuration method graphic tutorial

This article shares the specific code of MySQL 8....

How to use HTML+CSS to create TG-vision homepage

This time we use HTML+CSS layout to make a prelim...

Usage and principles of provide and inject in Vue3

Preface: When passing data between parent and chi...