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
The topic I want to share with you today is: &quo...
Overview In actual business scenario applications...
KVM stands for Kernel-based Virtual Machine, whic...
Table of contents 1. Structural instructions Modu...
This article example shares the specific code of ...
Table of contents 1. Introduction 2. Create a Vit...
Event bubbling, event capturing, and event delega...
What is ZooKeeper ZooKeeper is a top-level projec...
During the installation of Ubuntu 18, the mmx64.e...
Table of contents 1. Environment 2. Preparation 3...
Table of contents Download and install JDK Downlo...
Table of contents 1. Interface definition 2. Attr...
This article shares the specific code of MySQL 8....
This time we use HTML+CSS layout to make a prelim...
Preface: When passing data between parent and chi...