您现在的位置: 万盛学电脑网 >> 程序编程 >> 网页制作 >> DivCSS教程 >> 正文

div css百分比适应的方法

作者:佚名    责任编辑:admin    更新时间:2022-06-22

欢迎大家在这里学习div css百分比适应!下面是我们给大家整理出来的精彩内容。希望大家在这里学习!

<!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=gb2312" /> 
<title>css2.0 VS ie</title> 
<style type="text/css"> 
<!-- 
body { 
font-size: 12px; 
text-align: center; 
margin: 0px; 
padding: 0px; 

#pic{ 
  margin:0 auto; 
  width:800px; 
  padding:0; 
  border:1px solid #333; 
  } 
#pic img{ 
    max-width:780px; 
width:expression(document.body.clientWidth>document.getElementById("pic").scrollWidth*9/10? "780px": "auto" ); 
border:1px dashed #000; 

--> 
</style> 
</head> 
<body> 
<div id="pic"> 
<img src=/uploadfile/2015/0922/20150922110213585.jpg" > 
</div> 
</body> 
</html>

好了,div css百分比适应内容就给大家介绍到这里了。希望大家继续关注我们的网站!

相关推荐:

自动调整高度的div层的方法