Foundation text
Foundation Default Settings
Foundation uses the browser default font size (font-size:100%
). For most desktop browsers, the font defaults to 16px. For most mobile browsers, the font defaults to 12px. The default font is "Helvetica Neue"
, and the default line-height is 1.5
.
The above default settings are all for the <body>
element.
Foundation text arrangement design
In this chapter we will discuss Foundation’s text arrangement design.
Please click the "Try it" button to view the actual styles of the following examples.
##<h1> - <h6>Foundation rendered HTML title (
<h1> to
<h6> ;) as follows:
<!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»Click the "Run Instance" button View online examples
Tips: If you need to create a light-colored header, you can add .subheader to the element Class:
<!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>
Run Instance»Click the "Run Instance" button to view the online instance
<small>In Foundation, the HTML
<small> element is used to create a light subtitle:
<!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»Click the "Run Instance" button to view the online instance
<a>
<!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»Click the "Run Instance" button to view the online instance
<abbr>Foundation
<abbr> The style of the element is as follows:
<!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>
Run Instance»Click the "Run Instance" button to view the online instance
<blockquote>Foundation
< ;blockquote> The style of the element is as follows:
<!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>
Run instance»Click" Run instance" button to view the online instance
<dl>Foundation
<dl> The style of the element is as follows:
<!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>
##<code>Foundation
<code> The style of the element is as follows:
<!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 Example»Click "Run instance" button to view the online instance
<kbd>Foundation
<kbd> The style of the element is as follows:
<!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>
Run Instance»Click the "Run Instance" button to view the online instance
<hr>Foundation
<hr> The style of the element is as follows:
<!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 中 hr 元素是灰色的。</p> <hr> </div> </body> </html>
Run Instance»Click the "Run Instance" button to view the online instance