目录

Angular_material - 排版( Typography)

Angular Material提供各种排版CSS类,可用于在Angular JS应用程序中创建视觉一致性。

下表列出了不同的类及其描述。

Sr.No class名称和描述
1

md-display-1

使用Regular 34px显示文本。

2

md-display-2

使用Regular 45px显示文本。

3

md-display-3

使用Regular 56px显示文本。

4

md-display-4

使用Light 112px显示文本。

5

md-headline

使用Regular 24px显示文本。

6

md-title

显示Medium 20px的文本。

7

md-subhead

使用Regular 16px显示文本。

8

md-body-1

使用Regular 14px显示文本。

9

md-body-2

使用Medium 14px显示文本。

10

md-button

显示Medium 14px的按钮。

11

md-caption

使用Regular 12px显示文本。

例子 (Example)

以下示例显示了排版CSS类的使用。

am_typography.htm

<html lang = "en">
   <head>
      <link rel = "stylesheet"
         href = "https://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.css">
      <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
      <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-animate.min.js"></script>
      <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-aria.min.js"></script>
      <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-messages.min.js"></script>
      <script src = "https://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.js"></script>
      <link rel = "stylesheet" href = "https://fonts.googleapis.com/icon?family=Material+Icons">
      <script language = "javascript">
         angular
            .module('firstApplication', ['ngMaterial'])
            .controller('typographyController', typographyController);
         function typographyController ($scope) {               
         }	  
      </script>      
   </head>
   <body ng-app = "firstApplication"> 
      <div class = "frameContainer" ng-controller = "typographyController as ctrl"
         layout = "column" layout-padding layout-wrap layout-fill
         style = "padding-bottom: 32px;" ng-cloak>
         <p class = "md-display-4">.md-display-4</p>
         <p class = "md-display-3">.md-display-3</p>
         <p class = "md-display-2">.md-display-2</p>
         <p class = "md-display-1">.md-display-1</p>
         <p class = "md-headline">.md-headline</p>
         <p class = "md-title">.md-title</p>
         <p class = "md-subhead">.md-subhead</p>
         <p class = "md-body-1">.md-body-1</p>
         <p class = "md-body-2">.md-body-2</p>
         <md-button>.md-button</md-button>
         <p class = "md-caption">.md-caption</p>
      </div>
   </body>
</html>

结果 (Result)

验证结果。

新页面打开
↑回到顶部↑
WIKI教程 @2018