CSS size properties

In the process of web page creation, we may need to set the height, width, spacing, etc. of elements, which requires us to use someDimension attributes.

1. height attribute

The height attribute can set the height of an element high.

Inheritance: No

Possible values


##Value

Description

auto Default. The browser will calculate the actual height.

length Use px, cm and other units to define the height.

% Based on the percentage height of the block-level object that contains it.


2. line-height attribute

line-height attribute can Set the distance between lines.

Note: Negative values are not allowed.

Inheritance: Yes

Possible values


##Value

Description

normal Default. Set reasonable line spacing.

number Set a number that will be multiplied by the current font size to set the line spacing.

length Set a fixed line spacing.

% Percent line spacing based on the current font size.


3. max-height attribute

The max-height attribute can set the maximum height of an element.

Inheritance: No

Possible values

##Value
Description

none Default. The definition places no limit on the maximum height allowed for an element.

length defines the maximum height of the element.

% Defines the maximum height as a percentage of the block-level object that contains it.


4. The max-width attribute

max-width can define the maximum width of an element.

Inheritance: No

Possible values


##Value

Description

none Default. The definition places no limit on the maximum width of the element.

length defines the maximum width of the element.

% Defines the maximum width based on the percentage of the block-level object that contains it.


5. min-height attribute

The min-height attribute can set the minimum height of the element.

Inheritance: No

Possible values


Value

Description

length defines the minimum height of the element. The default value is 0.

% Defines the minimum height based on the percentage of the block-level object that contains it.


6. min-width attribute

The min-width attribute can set the minimum width of an element.

Inheritance: No

Possible values

Value #length defines the minimum width value of the element. Default: Depends on browser.% Defines the minimum width based on the percentage of the block-level object that contains it.

7. width attribute

The width attribute can set the width of an element.


Inheritance: No

Possible values

Value

Description

auto Default . The browser can calculate the actual width.

% Defines the width as a percentage based on the width of the parent element.length Use px, cm and other units to define the width.

Example:

    实例  

这是一段句子的高和宽是 100px.


##Example:


    实例  

北京时间周四凌晨两点公布的美联储9月纪要显示,如美国经济持续走强,几位有投票权的决策者认为利率应该“很快”会上升。 美联储在会议纪要中指出“几位委员们认为,如若经济进展如预期般展开,那么较快提高联邦基金利率将是合适的”。






Continuing Learning
||
实例

昨日香港银行同业人民币拆借利率出现明显飙升,隔夜离岸人民币Hibor涨82个基点报2.8284%, 创9月21日以来新高;一周离岸人民币Hibor涨262个基点报6.7610%,创9月20日以来新高,意味着离岸人民币流动性吃紧。

submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!