- Foundation 常規
- Foundation - 全域性樣式
- Foundation - Sass
- Foundation - JavaScript
- Foundation - JavaScript 實用工具
- Foundation - 媒體查詢
- Foundation - 網格
- Foundation - Flex 網格
- Foundation - 表單
- Foundation - 可見性類
- Foundation - 基本排版
- Foundation - 排版幫助器
- Foundation - 基本控制元件
- Foundation - 導航
- Foundation - 容器
- Foundation - 媒體
- Foundation - 外掛
- Foundation SASS
- Foundation - Sass 函式
- Foundation - Sass 混入
- Foundation 庫
- Foundation - 動作 UI
- Foundation 實用資源
- Foundation - 快速指南
- Foundation - 實用資源
- Foundation - 討論
Foundation - 文字對齊
描述
可以透過新增.text-left、.text-right、.text-center或.textjustify類來對齊元素文字。在文字對齊類前面放置一個斷點,將使對齊只在該螢幕尺寸或更大尺寸上應用。 例如,.medium-textcenter會將文字對齊到最小螢幕上的左側,但在螢幕尺寸為中等及更大時變為居中。
示例
以下示例演示了在 Foundation 中使用文字對齊。
<html>
<head>
<title>Text Alignment</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/foundation-sites@6.5.1/dist/css/foundation.min.css" crossorigin="anonymous">
<!-- Compressed JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/foundation-sites@6.5.1/dist/js/foundation.min.js" crossorigin="anonymous"></script>
</head>
<body>
<p class = "text-left">Foundation is one of the advanced front-end framework
for designing beautiful responsive websites. It works on all types of
devices and provides you with HTML, CSS and JavaScript plugins.
</p>
<p class = "text-right">Foundation is one of the advanced front-end
framework for designing beautiful responsive websites. It works on all
types of devices and provides you with HTML, CSS and JavaScript plugins.
</p>
<p class = "text-center">Foundation is one of the advanced front-end
framework for designing beautiful responsive websites. It works on all
types of devices and provides you with HTML, CSS and JavaScript plugins.
</p>
<p class = "text-justify">Foundation is one of the advanced front-end
framework for designing beautiful responsive websites. It works on all
types of devices and provides you with HTML, CSS and JavaScript plugins.
</p>
<p class = "medium-text-center">Foundation is one of the advanced front-end
framework for designing beautiful responsive websites. It works on all
types of devices and provides you with HTML, CSS and JavaScript plugins.
</p>
<script>
$(document).ready(function() {
$(document).foundation();
})
</script>
</body>
</html>
產出
讓我們執行以下步驟來了解以上給出的程式碼是如何工作的:
將以上給出的 HTML 程式碼另存為typography_text_alignment.html檔案。
在瀏覽器中開啟此 HTML 檔案,顯示的輸出如下所示。
foundation_typography_helpers.htm
廣告