overflow:溢出属性.溢出属性是用来处理内容所占的区域和一个固定尺寸的容器产生冲突后,以什么外观显示.对于定义好长款的层来说,溢出属性用来处理当层里的内容过多,这个尺寸显示不了全部内容时.层的外观如何定义.
-----------------------------------------------------------------------------
代码测试:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
div{
border:thin solid #F00;
width:300px;
height:80px;
}
</style>
<script type="application/javascript">
function setOverFlow(type){
document.getElementById("div1").style.overflow=type;//更改样式
}
</script>
</head>
<body>
<div id="div1">
这段文字是用来测试overflow效果的.overflow:溢出属性.溢出属性是用来处理内容所占的区域和一个固定尺寸的容器产生冲突后,以什么外观显示.对于定义好长款的层来说,溢出属性用来处理当层里的内容过多,这个尺寸显示不了全部内容时.层的外观如何定义.
</div>
<br />
<br />
<br />
<input type="button" onclick="setOverFlow('hidden')" value="隐藏(hidden)" width="100"/>
<input type="button" onclick="setOverFlow('visible')" value="隐藏(visible)" width="100"/>
<input type="button" onclick="setOverFlow('scroll')" value="滚动(scroll)" width="100"/>
<input type="button" onclick="setOverFlow('auto')" value="自动(hidden)" width="100"/>
</body>
</html>
------------------------------------------------------------------
效果演示:
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。