>  기사  >  웹 프론트엔드  >  怎么让右层随着左栏高度增高而增高呢?_html/css_WEB-ITnose

怎么让右层随着左栏高度增高而增高呢?_html/css_WEB-ITnose

WBOY
WBOY원래의
2016-06-24 12:06:32788검색


sdfsdf

sdfsf



回复讨论(解决方案)

等高布局

<!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>.box{width:800px;margin:100px auto;overflow:hidden;}.left{width:300px;background:red;padding-bottom:2000px;margin-bottom:-2000px;float:left;}.right{width:500px;background:green;padding-bottom:2000px;margin-bottom:-2000px;float:left;}</style></head><body><div class="box">	<div class="left">    	尝试添加内容尝试添加内容尝试添加内容尝试添加内容尝试添加内容尝试添加内容        尝试添加内容尝试添加内容尝试添加内容尝试添加内容尝试添加内容尝试添加内容    </div>    <div class="right"></div></div></body></html>

等高布局

<!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>.box{width:800px;margin:100px auto;overflow:hidden;}.left{width:300px;background:red;padding-bottom:2000px;margin-bottom:-2000px;float:left;}.right{width:500px;background:green;padding-bottom:2000px;margin-bottom:-2000px;float:left;}</style></head><body><div class="box">	<div class="left">    	尝试添加内容尝试添加内容尝试添加内容尝试添加内容尝试添加内容尝试添加内容        尝试添加内容尝试添加内容尝试添加内容尝试添加内容尝试添加内容尝试添加内容    </div>    <div class="right"></div></div></body></html>

那如果有border怎么办?

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.