Chinaunix首页 | 论坛 | 博客
  • 博客访问: 96113
  • 博文数量: 34
  • 博客积分: 925
  • 博客等级: 准尉
  • 技术积分: 350
  • 用 户 组: 普通用户
  • 注册时间: 2011-08-15 11:52
文章分类

全部博文(34)

文章存档

2011年(34)

我的朋友

分类: 系统运维

2011-08-18 14:03:48

CSS Height and Width

CSS includes height and width properties to help you specify the size of your elements.

'height' and 'width' Properties

Applies to all HTML elements except non-replaced inline elements, table columns and column groups.

Can use a fixed height (i.e. pixels) or a percentage height.

  1. <div style="background-color:orange;height:125px;width:75px;">
  2. This div has height and width applied.
  3. </div>
This results in:
This div has height and width applied.

'max-height' and 'max-width' Properties

Enables you to constrain the height and/or width of an element to a maximum value.

  1. <div style="background-color:orange;max-height:125px;max-width:75px;">
  2. This div has max-height and max-width applied.
  3. </div>

This div has max-height and max-width applied.

'min-height' and 'min-width' Properties

Enables you to constrain the height and/or width of an element to a minimum value.

  1. <div style="background-color:orange;min-height:125px;min-width:75px;">
  2. This div has min-height and min-width applied.
  3. </div>
This div has min-height and min-width applied.
阅读(271) | 评论(0) | 转发(0) |
0

上一篇:CSS Margin

下一篇:CSS Positioning

给主人留下些什么吧!~~