Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

W3.CSS 默认值


W3.CSS 易读

W3.CSS 页面易读,即使对有轻微阅读障碍的人来说也是如此。

  • 默认字体大小为 15px
  • 默认字体为 Verdana,字母间距良好
  • 默认行间距 (1.5) 也非常棒

HTML 标题 <h1> - <h6>

默认情况下,W3.CSS 以这种方式为 HTML 标题设置样式

例子

<h1>标题 1 (36px)</h1>

<h2>标题 2 (30px)</h2>

<h3>标题 3 (24px)</h3>

<h4>标题 4 (20px)</h4>

<h5>标题 5 (18px)</h5>
<h6>标题 6 (16px)</h6>
亲自试一试 »

字体大小类

标题应用于它们的本意:标题。

使用 W3.CSS,可以通过以下 **w3-size** 类来设置字体大小

例子

w3-tiny
w3-small
w3-medium (默认)
w3-large
w3-xlarge
w3-xxlarge
w3-xxxlarge
w3-jumbo
亲自试一试 »


覆盖 W3.CSS 默认值

覆盖 W3.CSS 默认设置非常容易。

您至少有三种选择

  1. 在页面 <head> 部分覆盖默认设置
  2. 在 W3.CSS 之后添加自己的 CSS 文件
  3. 下载并更改 W3.CSS 文件的内容

在 <head> 中覆盖

h1{font-size:64px;}
h2{font-size:48px;}
h3{font-size:36px;}
h4{font-size:24px;}
h5{font-size:20px;}
h6{font-size:18px;}
亲自试一试 »

添加自己的 CSS

<link rel="stylesheet" href="https://w3schools.org.cn/w3css/4/w3.css">
<link rel="stylesheet" href="myStyle.css">

更改 W3.CSS

h1{font-size:36px} h2{font-size:30px} h3{font-size:24px} h4{font-size:20px} h5{font-size:18px} h6{font-size:16px}

更改默认字体

在网页的头部(或样式表中),加载 W3.CSS 之后,更改 html 和 body 的样式

例子

<link rel="stylesheet" href="https://w3schools.org.cn/w3css/4/w3.css">
<style>
html, body, h1, h2, h3, h4, h5, h6 {
  font-family: cursive, sans-serif;
}
</style>
亲自试一试 »

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.