相对自适应高度
<div id="left"></div>
<div id="middle"></div>
<script language="javascript">
document.getElementById("left").style.height=document.getElementById("middle").scrollHeight+"px"
</script>
图片自适应大小
#pic{width:500px;height:500px;overflow: hidden;}#pic img{max-width:500px;width:expression(document.body.clientWidth > 500 ? "500px" : "auto");}
expression详解:
http://www.dvbbs.net/tech/page/2006031616845.asp
如果文字过长,则将过长的部分变成省略号显示
<DIV STYLE="width: 120px; height: 50px; border: 1px solid blue;
overflow: hidden; text-overflow:ellipsis">
<NOBR>就是比如有一行文字,很长,表格内一行显示不下.</NOBR>
</DIV>
只对IE内核有效。
asp中提取的字段显示的长度做一个限制,当超过这个数字的时候用省略号代替
[ <%
content=rs("content")
if len(content)>120 then
content=left(content,120)&"......"
end if
%>
response.write content ]
本文介绍如何实现网页元素的自适应高度及图片大小调整,并通过CSS样式控制文本溢出时以省略号形式展示。同时提供ASP中对提取字段长度限制的方法。
272

被折叠的 条评论
为什么被折叠?



