属性高级指定


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

1,Dimension :尺寸,用来控制控件的高与宽

  • img.big {height:120px}
  • p{max-height:100px;}? 最大高度,同样有:max-width; min-heigh; min-width;
  • 左右为left, right

2, Classification: 指定控件的显示方式

  • p {display: inline} 追加到上一行显示,即在同一行显示
  • span{display:block;} 控件已块显示,即分行显示
  • div {display: none} :不显示
  • img {float:right;} 图片浮动在右方
  • h2.pos_left{position:relative;left:-20px;} position:relative相对定位 position:absolute; 绝对定位 fixed; 固定
  • h1.visible {visibility:visible}? h1.hidden {visibility:hidden}? 控制控件是否显示
  • <span style=”cursor:pointer”>pointer</span><br /> 手形鼠标,指定鼠标样式 cursor:wait 等待
  • 定位:relative:相对于原来的位置移动,absolute:相对于页面移动,即相对于(0,0)

2,p

  • p:first-letter {color: #ff0000;font-size:xx-large;}? //首字母特别
  • p:first-line {color:#ff0000;font-variant:small-caps;} //首行特别
  • h1:before {content:”sdf”}? //在文本之前插入文字,或图片h1:before {content:url(smiley.gif)}
  • h1:after {content:url(smiley.gif)} //之后, before, after在IE中没有作用

3,z-index 属性设置元素的堆叠顺序
该属性设置一个定位元素沿 z 轴的位置,z 轴定义为垂直延伸到显示区的轴。如果为正数,则离用户更近,为负数则表示离用户更远。
注:Z-index 仅能在定位元素上奏效(例如 position:absolute;)