| S.N. |
數(shù)據(jù)類(lèi)型及說(shuō)明
|
示例 |
|---|---|---|
| 1 |
Numbers
它代表整數(shù)類(lèi)型
|
2, 10.5 |
| 2 |
Strings
單或雙引號(hào)中定義的字符序列
|
'Yiibai', "yiibai" |
| 3 |
Colors
用于定義顏色值
|
red, #008000, rgb(25,255,204) |
| 4 |
Booleans
布爾類(lèi)型返回true或false
|
10 > 9 指示為 true |
| 5 |
Nulls
它指定為空值,未知的數(shù)據(jù)
|
if(val==null) {//statements} |
| 6 |
Space and Comm
表示由空格或逗號(hào)分隔值
|
1px solid #eeeeee, 0 0 0 1px |
| 7 |
Mapping
它從一個(gè)值映射到另一個(gè)值
|
FirsyKey: frstvalue, SecondKey: secvalue |
<html>
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>字符串 - www.yiibai.com</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" >
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>字符串使用示例</h2>
<p class="yiibai">Sass is an extension of CSS that adds power and elegance to the basic language.</p>
</div>
</body>
</html>
接下來(lái),產(chǎn)生一個(gè)文件:style.scss.
$name: "yiibai";
p.#{$name} {
color: blue;
}
sass --watch C:\Ruby22-x64\style.scss:style.css
p.yiibai{
color: blue;
}
nth 函數(shù): 它提供了列表的特定的項(xiàng)目
join 函數(shù): 它將多個(gè)列表加入成為一個(gè)列表
append 函數(shù): 追加的項(xiàng)目到列表的另一端
@each 指令: 它提供列表中每個(gè)項(xiàng)目的樣式
10px 11px, 15px 16px
{10px 11px} {15px 16px}
$map: (FirsyKey: frstvalue, SecondKey: secvalue, Thirdkey: thdvalue);
map-get: 提供映射的值。
map-merge: 它增加值到映射中
@each directive: 它規(guī)定了鍵/值對(duì)映射的樣式