CSS 宽高 width height
<h2>css width 和 height 属性设置对象的宽高度</h2>
<strong>语法:</strong>
<pre class=“line-numbers language-css”><code class=“language-css”>
height : auto | length
width : auto | length
</code></pre>
<h2></h2>
<strong>参数:</strong>
auto : 无特殊定位,根据HTML定位规则载文档流中分配
length : 由浮点数字和单位标识符组成的长度值 | 百分数。百分数是基于父对象的高度。不可为负数。
<h2></h2>
<strong>说明:</strong>
检索或设置对象的高度或者宽度。
对于img对象来说,仅指定此属性,其width值将根据图片源尺寸等比例缩放。
对应的脚本特性为height或者width。其值为一字符串,所以不可用于脚本(Scripts)中的计算。请使用style对象的posHeight,pixelHeight,以及对象的offsetHeight或者posWidth,pixelWidth,以及对象的offsetWidth等特性。
对应的脚本特性为 height 。
<h2></h2>
<strong>示例:</strong>
<pre class=“line-numbers language-css”><code class=“language-css”>
div { width: 100px; }
div { position:absolute; top:-3px; width:6px; }
div { height: 60px; }
div { position:absolute; top:-3px; height:6px; }
</code></pre>
<h2>定义和用法</h2>
height 属性设置元素的高度。
width 属性设置元素的宽度。
<h2></h2>
<strong>说明</strong>
这个属性定义元素内容区的高度,在内容区外面可以增加内边距、边框和外边距。
行内非替换元素会忽略这个属性。
<h2></h2>
<div>
<table>
<tbody>
<tr>
<th style=“width:25%;”> 默认值:</th>
<td style=“width:75%;”>auto</td>
</tr>
<tr>
<th> 继承性:</th>
<td>no</td>
</tr>
<tr>
<th> 版本:</th>
<td>CSS1</td>
</tr>
</tbody>
</table>
</div>
<h2>可能的值</h2>
<table>
<tbody>
<tr>
<th> 值</th>
<th> 描述</th>
</tr>
<tr>
<td>auto</td>
<td>默认。浏览器会计算出实际的高度。</td>
</tr>
<tr>
<td><i>length</i></td>
<td>使用 px、cm 等单位定义高度。</td>
</tr>
<tr>
<td><i>%</i></td>
<td>基于包含它的块级对象的百分比高度。</td>
</tr>
<tr>
<td>inherit</td>
<td>规定应该从父元素继承 height 属性的值。</td>
</tr>
</tbody>
</table>
<span style=“color:red;”><strong>注:所有主流浏览器都支持 height 和 width 属性。</strong></span>

评论区
模板挺不错。
WindowsChrome
哈哈,这都是作者的功劳 [微笑]
WindowsFirefox