How to set cursive font in css

王林
Release: 2023-01-03 09:28:41
Original
4921 people have browsed it

How to set cursive font in css: You can use the font-family attribute to set it, such as [body{font-family:cursive;}]. The attribute value cursive represents the cursive font.

How to set cursive font in css

The operating environment of this article: windows10 system, css 3, thinkpad t480 computer.

In CSS, if we want to set the font style of an element, we can use the font-family attribute.

font - The family attribute specifies the font of an element.

For example, if we want to set the font style of an element to cursive, we can write like this:

body{
     font-family:cursive;
}
Copy after login

We can also set the font style as follows:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文网(php.cn)</title>
<style>
p.serif{font-family:"Times New Roman",Times,serif;}
p.sansserif{font-family:Arial,Helvetica,sans-serif;}
</style>
</head>

<body>
<h1>CSS font-family</h1>
<p class="serif">这一段的字体是 Times New Roman </p>
<p class="sansserif">这一段的字体是 Arial.</p>

</body>
</html>
Copy after login

(Free Video tutorial: css video tutorial)

Running results:

How to set cursive font in css

##Related recommendations:

CSS tutorial

The above is the detailed content of How to set cursive font in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!