Html的部分常用技巧

作者在 2006-07-15 16:40:00 发布以下内容
解决下拉列表框显示在层上面的问题
在层里面加上一个iframe,优先级就比下拉列表框高了
<iframe style="position:absolute; visibility:inherit; top:0px; left:0px; width:640px; height:100%; z-index:-1;"></iframe>

颜色渐变
style="filter:progid:DXImageTransform.Microsoft.Gradient(startColorStr='#FFFFFF', endColorStr='#3F8CDA', gradientType='1')"

截断英文单词
style="word-wrap:break-word" style="word-break:break-all"

带阴影的文字
style="filter: DropShadow(Color=#dddddd, OffX=1, OffY=1);height:12px;font-family:Verdana;CURSOR: hand"

文字的白边
<P style="MARGIN-LEFT: 3px; MARGIN-TOP: 5px">

文字的间距
style="LETTER-SPACING:1px;line-height:150%"

表格不随内容撑大
style="table-layout:fixed;"

固定的一个地方显示较多数据
简单将你的控件放在一个DIV中将overflow属性设置成auto
<div style="height:400px;width:200px;overflow:auto">
<asp:datagrid id="MyGrid" runat="server"/>
</div>

用层遮盖其他东西(相对定位)
<center>
<div style="position:absolute;">
<div style="position:absolute;left:-50;top:-58"><table><tr><td width=100 height=16 bgcolor=ffff00></td></tr></table></div>
</div>
</center>

透明
style="FILTER: Alpha(Opacity=100, style=1)"

使用CSS替换图片
star:expression(
    onmouseover = function()
    {
        /*替换图片*/
        if(this.hover != null){
          this.name = this.src;
          this.src = this.src.replace('.jpg', '_over.jpg');
          this.HasChg = 1;
       }
   },
   onmouseout = function()
  {  
       /*还原本来的图片*/
     if(this.HasChg != null){
        this.src = this.name;
        this.HasChg = null;
    }
}
网页设计 | 阅读 1489 次
文章评论,共0条
游客请输入验证码
浏览19183次