對于html valign屬性的作用與使用方法詳細說明(附使用方法案例)
發表時間:2023-09-04 來源:明輝站整理相關軟件相關文章人氣:
[摘要]本篇文章為大家介紹了關于html<td>標簽中的valign屬性和html<th>標簽中的valign屬性,一個屬性能在不同的標簽下運用,這種屬性都是比較好記的,不是很難,希望大家認真閱讀。html valign屬性的定義和用法:valign 屬性規定單元格中內容的垂直排列...
本篇文章為大家介紹了關于html<td>標簽中的valign屬性和html<th>標簽中的valign屬性,一個屬性能在不同的標簽下運用,這種屬性都是比較好記的,不是很難,希望大家認真閱讀。
html valign屬性的定義和用法:
valign 屬性規定單元格中內容的垂直排列方式。
valign屬性趨向于垂直對齊,其值包含:top(對內容進行上對齊)、bottom(對內容進行下對齊)、middle(對內容進行居中對齊)、baseline(與基線對齊)
html valign屬性的baseline值:
基線是一條虛構的線。在一行文本中,大多數字母以基線為基準。baseline 值設置行中的所有表格數據都分享相同的基線。該值的效果常常與 bottom 值相同。不過,如果文本的字號各不相同,那么 baseline 的效果會更好
html valign屬性的語法:
<td valign="value">
HTML <td> 標簽的 valign 屬性實例
帶有不同垂直對齊單元格的表格:
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td valign="top">January</td>
<td valign="top">$100</td>
</tr>
<tr>
<td valign="bottom">February</td>
<td valign="bottom">$80</td>
</tr>
</table>
html5 <td>標簽的valign屬性的使用方法實例:
<html>
<body>
<table border="1" style="height:200px">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td valign="bottom">January</td>
<td valign="bottom">$100</td>
</tr>
<tr>
<td valign="baseline">February</td>
<td valign="baseline" style="font-size:200%">$80</td>
</tr>
</table>
</body>
</html>
HTML<th>標簽的valign屬性示例:
在下列HTML表格里,不同表頭單元格具有不同的垂直對齊方式:
<table border="1" style="height:200px">
<tr>
<th valign="middle">月份</th>
<th valign="bottom">存款</th>
</tr>
<tr>
<td>一月</td>
<td>100</td>
</tr>
</table>
HTML<th>標簽valign屬性的定義及用法:
<th>標簽的valign屬性用于指出表頭單元格中內容的垂直對齊方式。
所有主流瀏覽器均支持<th>標簽的valign屬性。
HTML<th>標簽valign屬性的語法:
<th valign="value">
HTML<th>標簽valign屬性的屬性值:

瀏覽器支持
所有瀏覽器都支持 valign 屬性。
【小編的相關推薦】
html font標簽怎么設置字體樣式?利用CSS控制文字大小的方法
html style標簽是什么意思?關于style標簽的使用方法詳解
以上就是關于html valign屬性的作用和使用方法詳解(附使用方法實例)的詳細內容,更多請關注php中文網其它相關文章!
網站建設是一個廣義的術語,涵蓋了許多不同的技能和學科中所使用的生產和維護的網站。