Teks asas
Tetapan Lalai Yayasan
Yayasan menggunakan saiz fon lalai penyemak imbas (font-size:100%
). Untuk kebanyakan penyemak imbas desktop, fon lalai kepada 16px. Untuk kebanyakan penyemak imbas mudah alih, fon lalai kepada 12px. Fon lalai ialah "Helvetica Neue"
, dan ketinggian garisan lalai kepada 1.5
.
Tetapan lalai di atas semuanya untuk elemen <body>
.
Reka bentuk susunan teks asas
Dalam bab ini kita akan membincangkan reka bentuk susunan teks Yayasan.
Sila klik butang "Cuba" untuk melihat gaya sebenar contoh berikut.
<h1> - <h6>
Yayasan memberikan tajuk HTML (<h1>
kepada <h6>
) kelihatan seperti ini:
Instance
<!DOCTYPE html> <html> <head> <title>Foundation 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body> <div style="padding:20px;"> <h2>标题</h2> <p>标题不同元素字体大小不一样。以下字体默认加粗,不同设备尺寸显示的字体也是不一样的,你可以通过重置浏览器窗口大小查看效果。</p> <h1>h1 标题 (<strong>2.125rem</strong> - 2.75rem)</h1> <h2>h2 标题 (<strong>1.6875rem</strong> - 2.3125rem)</h2> <h3>h3 标题 (<strong>1.375rem</strong> - 1.6875rem)</h3> <h4>h4 标题 (<strong>1.125rem</strong> - 1.4375rem)</h4> <h5>h5 标题 (1.125rem)</h5> <h6>h6 标题 (1rem)</h6> </div> </body> </html>
Run Instance»
Klik butang "Run Instance" untuk melihat instance dalam talian
Petua: Jika anda perlu mencipta tajuk ringan, anda boleh menambah kelas .subheader
pada elemen:
Instance
<!DOCTYPE html> <html> <head> <title>Foundation 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body> <div style="padding:20px;"> <h2>副标题</h2> <p> .subheader 类让标题的文本颜色变浅。</p> <h1 class="subheader">h1.subheader</h1> <h2 class="subheader">h2.subheader</h2> <h3 class="subheader">h3.subheader</h3> <h4 class="subheader">h4.subheader</h4> <h5 class="subheader">h5.subheader</h5> <h6 class="subheader">h6.subheader</h6> </div> </body> </html>
Jalankan Instance»
Klik butang "Run Instance" untuk melihat contoh dalam talian
<small>
In Foundation , elemen HTML <small>
Digunakan untuk mencipta sari kata ringan:
Instance
<!DOCTYPE html> <html> <head> <title>Foundation 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body> <div style="padding:20px;"> <h2>Small</h2> <p>small 元素用于创建一个浅色的副标题。</p> <h1>h1 heading <small>secondary text</small></h1> <h2>h2 heading <small>secondary text</small></h2> <h3>h3 heading <small>secondary text</small></h3> <h4>h4 heading <small>secondary text</small></h4> <h5>h5 heading <small>secondary text</small></h5> <h6>h6 heading <small>secondary text</small></h6> </div> </body> </html>
Run Instance»
Klik butang "Jalankan Instance" Lihat kejadian dalam talian
<a>
<abbr>
Foundation <abbr>
Gaya daripada elemen adalah seperti berikut:
Instance
<!DOCTYPE html> <html> <head> <title>Foundation 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body> <div style="padding:20px;"> <h2>链接</h2> <p>Foundation 的 <a href="#">链接样式</a>。</p> </div> </body> </html>
Run Instance»
Klik butang "Run Instance" untuk lihat contoh dalam talian
<blockquote>
Foundation <blockquote>
elemen digayakan seperti berikut:
Instance
<!DOCTYPE html> <html> <head> <title>Foundation 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body> <div style="padding:20px;"> <h2>Abbreviations</h2> <p>abbr 元素用于标签指示简称或缩写。</p> <p>The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.</p> </div> </body> </html>
Jalankan Instance»
Klik butang "Run Instance" untuk melihat contoh dalam talian
<dl>
Asas <dl>
Gaya elemen adalah seperti berikut:
Instance
<!DOCTYPE html> <html> <head> <title>Foundation 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body> <div style="padding:20px;"> <h2>引用</h2> <p>blockquote 元素用于定义块引用。</p> <blockquote> <p> php中文网</p> <cite>php中文网</cite> </blockquote> </div> </body> </html>
Jalankan Instance»
Klik butang "Run Instance" untuk melihat contoh dalam talian
<code>
Yayasan <code>
Gaya elemen adalah seperti berikut:
Instance
<!DOCTYPE html> <html> <head> <title>Foundation 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body> <div style="padding:20px;"> <h2>描述列表</h2> <p>dl 元素用于定义一个描述性列表:</p> <dl> <dt>Coffee</dt> <dd>- black hot drink</dd> <dt>Milk</dt> <dd>- white cold drink</dd> </dl> </div> </body> </html>
Run Instance»
Klik " Butang Run Instance" untuk melihatnya dalam talian Contoh
<kbd>
Asas <kbd>
Gaya elemen adalah seperti berikut:
Instance
<!DOCTYPE html> <html> <head> <title>Foundation 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body> <div style="padding:20px;"> <h2>Code 片段</h2> <p>代码片段展示可以使用 code 元素:</p> <p>以下 HTML 元素: <code>span</code>, <code>section</code>, 和 <code>div</code> 是文档的一部分。</p> </div> </body> </html>
Run Instance»
Klik butang "Run Instance" untuk melihat instance dalam talian
<hr>
Elemen Foundation <hr>
digayakan seperti berikut:
Instance
<!DOCTYPE html> <html> <head> <title>Foundation 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://static.php.cn/assets/foundation-5.5.3/foundation.min.css"> <script src="http://static.php.cn/assets/jquery/2.0.3/jquery.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/foundation.min.js"></script> <script src="http://static.php.cn/assets/foundation-5.5.3/js/vendor/modernizr.js"></script> </head> <body> <div style="padding:20px;"> <h2>键盘输入</h2> <p>使用 kbd 元素来接收键盘的输入指令:</p> <p>按下 <kbd>ctrl + p</kbd> 键打开打印窗口。</p> </div> </body> </html>
Jalankan Instance»
Klik butang "Run Instance" " untuk melihat contoh dalam talian