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

The combination and difference between ENTRYPOINT and CMD in dockerfile

In the previous article [Detailed explanation of ...

Fixed table width table-layout: fixed

In order to make the table fill the screen (the re...

Detailed graphic tutorial on how to enable remote secure access with Docker

1. Edit the docker.service file vi /usr/lib/syste...

WeChat Mini Program Lottery Number Generator

This article shares the specific code of the WeCh...

Detailed example of using typescript to encapsulate axios in Vue3

This axios package is used in the vue3 demo. For ...

Some notes on installing fastdfs image in docker

1. Prepare the Docker environment 2. Search for f...

Use of hasOwnProperty method of js attribute object

Object's hasOwnProperty() method returns a Bo...

Example code for implementing ellipse trajectory rotation using CSS3

Recently, the following effects need to be achiev...

Solution to the ineffective margin of div nested in HTML

Here's a solution to the problem where margin...

wget downloads the entire website (whole subdirectory) or a specific directory

Use wget command to download the entire subdirect...

JavaScript Basics Variables

Table of contents 1. Variable Overview 1.1 Storag...

Detailed explanation of Nginx's control over access volume

Purpose Understand the Nginx ngx_http_limit_conn_...

How to implement Ajax concurrent request control based on JS

Table of contents Preface Ajax serial and paralle...

Content-type description, that is, the type of HTTP request header

To learn content-type, you must first know what i...