、行級標簽轉換為塊級標簽
轉換為塊級標簽,各自獨占一行,且可以設置寬高
代碼:<a href="">我是a標簽</a>
<a href="">我是a標簽</a>
<a href="">我是a標簽</a>
CSS :display:block;
width: 100px;
height: 30px;
border: 1px solid black;
在瀏覽器中的樣式:
二、塊級標簽轉換為行級標簽
轉化為行級標簽,共同占一行,不能設置寬高
代碼:<h3>我是塊級標簽</h3>
<h3>我是塊級標簽</h3>
<h3>我是塊級標簽</h3>
CSS:display: inline;
width: 200px;
height: 100px;
border: 1px solid red;
在瀏覽器中的樣式:
三、轉化為行內塊級標簽
能共占一行,而且可以設置各自的寬高
1.行級元素轉化為行內塊級元素
代碼:<a class="a1" href="">我是a標簽</a>
<a class="a2" href="">我是a標簽</a>
CSS: a{ display:inline-block; border: 1px solid black; }
.a1{width: 100px; height: 30px; }
.a2{ width: 50px; height: 50px; }
在瀏覽器中的樣式:
2.塊級標簽轉化為行內塊級標簽
代碼:<h3 class="h3_1">我是塊級標簽</h3>
<h3 class="h3_2">我是塊級標簽</h3>
CSS:h3{display: inline-block;border: 1px solid red;}
.h3_1{width: 100px;height: 100px;}
.h3_2{width: 200px;height: 50px;}
在瀏覽器中的樣式:
四、display的另一個屬性,可以將元素隱藏
display:none;
如果想了解更多塊級標簽和行內標簽的屬性,請關注,參看上一篇文章,有寫的不對或不全面的地方,請大家多多指出。
本屬性
字體了解之后,接下來我們了解一下文本屬性。縮進、角標、間距、排版等。
text-decoration
文本裝飾
值 | 描述 |
---|---|
none | 默認。定義標準的文本。 |
underline | 定義文本下的一條線。 |
overline | 定義文本上的一條線。 |
line-through | 定義穿過文本下的一條線。 |
blink | 定義閃爍的文本。 |
inherit | 規定應該從父元素繼承 text-decoration 屬性的值。 |
text-transform
值 | 描述 |
---|---|
none | 默認。定義帶有小寫字母和大寫字母的標準的文本。 |
capitalize | 文本中的每個單詞以大寫字母開頭。(僅針對首字母) |
uppercase | 定義僅有大寫字母。 |
lowercase | 定義無大寫字母,僅有小寫字母。 |
inherit | 規定應該從父元素繼承 text-transform 屬性的值。 |
text-indent
文本縮進,設置文本的起點,一般我們進行首行縮進。
1 | p{text-indent: 2em;} |
tip:這個玩意也會繼承。
example
1 2 3 4 5 6 7 8 9 10 11 | <style type="text/css"> .box{text-indent: 2em;width: 400px;border: 1px solid #333;} </style> <body> <div class="box"> 一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題 <p>一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題</p> <p>一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題</p> <p>一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題一個很重要的問題</p> </div> </body> |
text-algin
文本對齊方式
值 | 描述 |
---|---|
left | 把文本排列到左邊。默認值:由瀏覽器決定。 |
right | 把文本排列到右邊。 |
center | 把文本排列到中間。 |
justify | 實現兩端對齊文本效果 |
letter-spacing
字符間距
這個貌似也沒啥說的還是過了吧。。。?乛?乛?
word-spacing
單詞間距,親啊一定要區分清楚啊。 Hi girl!我只能說很少用,畢竟我們不寫英文。
line-height
行高,數字。
在css里邊最tm難理解的兩個東西它就是其中一個。尷尬…
先來個圖!
green:top(頂線)
blue:middle(中線)
red:baseline(基線)
pink:bottom(底線)
example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <style> /* 設置字體我們可以同時設置行高,意思就是可以采用數字 2的含義是基于字體大小的倍數 通常我們不會這樣子寫,因為會設置字體的大小,如果是瀏覽器默認的值當然可以這樣子寫。 */ /* css中行高平均分布在一行文本的上下。 這里字體的默認大小是16px,line-height為2那么就是32px,多出來的 16px怎么會在文本的上下各填充8px。但是這樣子好像有點... 直接line-height: 32px多好費勁 ⊙︿⊙. */ .p{width: 200px;height: 32px;text-align: center;line-height: 2;border: 1px solid red;} </style> <body> <p>行高,沒錯就是我</p> </body> |
vertical-align
垂直對齊 以基線為參照上下移動文本,但是這個玩意只能影響行內元素
在css里邊最tm難理解的另一個。
example
1 2 3 4 5 6 | <style> p sub{font-size:60%; vertical-align:-.4em;} </style> <body> <p>H<sub>2</sub>O. 10<sup>5</sup></p> </body> |
tip:vertical-align通常用來讓兩個行內元素對齊,雖然我們有時候設置了大小行高,行內的元素有時候也無發正常居中畢竟line-height是對文字的。這里line-height與vertical-align大家知道怎么去使用碰到問題解決問題,不要深究,會死。
last
最后給大家看一下字體與文本的結合,英文的排版樣式布局。欣賞一下!
@import url(http://fonts.googleapis.com/css?family=Pinyon+Script); *{margin: 0;padding: 0;} body{ font-family:"CrimsonRoman", georgia, times, serif; background-color:#fff; margin:100px 10% 0; } /* 設置h2的字體 文本*/ h2{ font-size:18px; line-height:24px; font-weight:bold; text-align:center; font-variant:small-caps; word-spacing:.5em; letter-spacing:.6em; } /* 設置h1的字體 文本 */ h1{ font-size: 60px; line-height:96px; font-family:"Pinyon Script", cursive; margin:4px 0 -4px; text-align:center; font-weight:normal; } p { font-size:18px; line-height:24px; } /* 設置長引用的邊距 */ blockquote {margin:0px 20%;} /* 設置引用字體的樣式 */ q { font-size:18px; font-style:italic; line-height:24px; } /* 首字母下沉 */ h1 + p::first-letter { font-family:times, serif; font-size:90px; float:left; line-height:.65; padding:.085em 3px 0 0; } /* 修改第一行的文本 小型大寫字母 */ h1 + p::first-line { font-variant:small-caps; letter-spacing:.15em; } /*只縮進跟在段落后面的段落*/ p + p {text-indent:14px;} /*引用內容前面的引號*/ q::before {content:"\201C"} /*引用內容后面的引號*/ q::after {content:"\201D"} |
1 2 3 4 5 6 7 8 9 10 11 | <!-- q標簽 文本兩端插入引號 --> <!-- blockquote標簽 標記長引用 會給元素的前后添加邊距 --> <h2>an excerpt from</h2> <h1>The Hound of the Baskervilles</h1> <p>Holmes stretched out his hand for the manuscript and flattened it upon his knee. “You will observe, Watson, the alternative use of the long s and the short. It is one of several indications which enabled me to fix the date.” At the head was written: “Baskerville Hall,” and below in large, scrawling figures: “1742.”</p> <p>“It appears to be a statement of some sort.”</p> <p>“Yes—it is a statement of a certain legend which runs in the Baskerville family.”</p> <blockquote> <q>Of the origin of the Hound of the Baskervilles there have been many statements, yet as I come in a direct line from Hugo Baskerville, and as I had the story from my father…</q> </blockquote> <p>When Dr. Mortimer had finished reading this singular narrative he pushed his sp |
Q&A
1 2 3 4 5 6 7 8 9 10 11 | <input type="button" value="按鈕"> <input type="button" value="按鈕"> <input type="button" value="按鈕"> <button>6</button> <button>6</button> <button>6</button> <div style="border: 1px solid #333;width:300px;"> <img src="url" width="300"> </div> |
發現問題了嗎? 行內元素在換行顯示之后回車被html解析了。
國工商銀行、中國農業銀行、中國銀行和中國建設銀行于2019年9月11日至9月15日同時辦理中華人民共和國成立70周年雙色銅合金紀念幣兩批次的預約業務。公眾可通過上述四家銀行業金融機構官方網站或前往其營業網點進行預約登記。
中國銀行負責天津、山西、福建、湖北、湖南、廣西、重慶、陜西等地區;
如果你不在上面地區,請點擊下面相應銀行進行預約。
中國農業銀行負責江蘇、安徽、江西、山東、海南、貴州、西藏、青海、新疆等地區;
中國工商銀行負責上海、內蒙古、遼寧、吉林、廣東(含深圳市)、四川等地區;
中國建設銀行負責北京、河北、黑龍江、浙江、河南、云南、甘肅、寧夏等地區。
中華人民共和國成立70周年雙色銅合金紀念幣每人預約、兌換限額為20枚。
中華人民共和國成立70周年雙色銅合金紀念幣第一批次于2019年9月19日至9月23日辦理預約兌換,第二批次于2019年10月25日至10月30日辦理預約兌換。公眾可按照約定的時間,持在預約系統中登記的有效身份證件,前往約定的營業網點辦理預約兌換業務。
中行新中國成立70周年紀念幣微信預約入口
注:入口要預約開始時才開放,未到時間會顯示“暫無可預約的產品”。
中行新中國成立70周年紀念幣網站預約入口
中行可直接復制以下網址:https://cmcoins.boc.cn/BOC15_CoinSeller/welcome.html
*請認真填寫需求信息,我們會在24小時內與您取得聯系。