기초 텍스트
Foundation 기본 설정
Foundation은 브라우저의 기본 글꼴 크기(font-size:100%
)를 사용합니다. 대부분의 데스크탑 브라우저의 경우 글꼴 기본값은 16px입니다. 대부분의 모바일 브라우저의 경우 글꼴 기본값은 12px입니다. 기본 글꼴은 "Helvetica Neue"
이고 기본 줄 높이는 1.5
입니다. font-size:100%
)。对于大多数桌面浏览器来说,字体默认为 16px。对于大多数移动端浏览器来说,字体默认为 12px。默认的字体为 "Helvetica Neue"
, line-height 默认为 1.5
。
以上默认的设置均是针对 <body>
元素。
Foundation 文字排列设计
本章节我们将讨论 Foundation 的文字排列设计。
以下实例的真实样式请通过点击"尝试一下"按钮查看。
<h1> - <h6>
Foundation 渲染的 HTML 标题 (<h1>
到<h6>
) 如下所示:
实例
<!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>
运行实例 »
点击 "运行实例" 按钮查看在线实例
提示: 如果需要创建一个浅色的标题,可以在元素上添加 .subheader
类:
实例
<!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>
运行实例 »
点击 "运行实例" 按钮查看在线实例
<small>
在 Foundation 中, HTML <small>
元素用于创建一个浅色的副标题:
实例
<!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>
运行实例 »
点击 "运行实例" 按钮查看在线实例
<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>
运行实例 »
点击 "运行实例" 按钮查看在线实例
<abbr>
Foundation <abbr>
元素的样式如下所示:
实例
<!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>
运行实例 »
点击 "运行实例" 按钮查看在线实例
<blockquote>
Foundation <blockquote>
元素的样式如下所示:
实例
<!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>
运行实例 »
点击 "运行实例" 按钮查看在线实例
<dl>
Foundation <dl>
<body>
요소에 대한 것입니다. Foundation 텍스트 배열 디자인
🎜<h1> - <h6>🎜🎜Foundation에서 렌더링된 HTML 제목(
~ ) 아래와 같이 표시됩니다: 🎜🎜🎜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>
🎜
인스턴스 실행»🎜"인스턴스 실행" 버튼을 클릭하세요 온라인 예시 보기🎜🎜🎜팁: 라이트 헤더를 생성해야 하는 경우 요소에 .subheader
클래스를 추가할 수 있습니다: 🎜🎜🎜Example🎜🎜<!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>
🎜
인스턴스 실행»🎜온라인 인스턴스를 보려면 "인스턴스 실행" 버튼을 클릭하세요🎜🎜
🎜 <small>🎜 🎜Foundation에서는 HTML <small>
요소를 사용하여 가벼운 자막을 만듭니다. 🎜🎜🎜Example🎜🎜<!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>
🎜
인스턴스 실행»🎜온라인 인스턴스를 보려면 "인스턴스 실행" 버튼을 클릭하세요🎜🎜
🎜<a>🎜🎜🎜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 中 hr 元素是灰色的。</p>
<hr>
</div>
</body>
</html>
🎜
인스턴스 실행»🎜온라인 인스턴스를 보려면 "인스턴스 실행" 버튼을 클릭하세요🎜🎜
🎜<abbr>🎜🎜Foundation <abbr>
요소의 스타일은 다음과 같습니다: 🎜🎜🎜Instance🎜🎜rrreee🎜
예제 실행» 🎜온라인 예제를 보려면 "예제 실행" 버튼을 클릭하세요🎜🎜
🎜<blockquote>🎜🎜Foundation <blockquote>
요소의 스타일은 다음과 같습니다: 🎜🎜🎜Instance 🎜🎜rrreee🎜
인스턴스 실행»🎜온라인 인스턴스를 보려면 "인스턴스 실행" 버튼을 클릭하세요.🎜🎜
🎜<dl>🎜🎜Foundation <dl>
요소의 스타일은 다음과 같습니다. 🎜🎜 🎜인스턴스🎜🎜rrreee🎜
인스턴스 실행»
온라인 인스턴스를 보려면 "인스턴스 실행" 버튼을 클릭하세요
<code>
Foundation <code>
요소의 스타일은 다음과 같습니다. <code>
元素的样式如下所示:
<kbd>
Foundation <kbd>
元素的样式如下所示:
<hr>
Foundation <hr>
<kbd>
요소의 스타일은 다음과 같습니다: 🎜🎜 🎜Instance🎜🎜rrreee🎜🎜🎜Run Instance»🎜🎜온라인 인스턴스를 보려면 "인스턴스 실행" 버튼을 클릭하세요🎜🎜🎜🎜<hr>🎜🎜Foundation < ;hr>
요소의 스타일은 다음과 같습니다: 🎜🎜🎜Instance🎜🎜rrreee🎜🎜🎜Run Instance»🎜🎜온라인 인스턴스를 보려면 "인스턴스 실행" 버튼을 클릭하세요🎜🎜