我是新来的,目前我正在做一个项目,我坚持这一点。主div内有3个div。而且我必须根据内容自动调整div的高度。任何人都可以为此提出解决方案。该代码是如何根据内容调整div的高度?
<!DOCTYPE html>
<html>
<head>
<style>
#rcorners2 {
position: absolute;
border-radius: 25px;
border: 2px solid #d3dce2;
padding: 20px;
width: 722px;
height:450px;
left: 151px;
top: 64px;
}
#img {
position: absolute;
width: 266px;
height: 260px;
left: 32px;
top: 42px;
}
#desc {
position: absolute;
font-size: 16px;
padding: 5px 15px 5px 5px;
width: 373px;
left: 321px;
top: 42px;
height: 100%;
line-height:1.6;
}
.vr {
width: 2px;
background-color: #d3dce2;
position: absolute;
top: 5px;
bottom: 50px;
left: 310px;
height: 317px;
}
</style>
</head>
<body>
<p>Rounded corners for an element with a border:</p>
<div id="rcorners2">
<div id="img">
<img src="SLT-A99V_wSAL2470Z_lg.jpg" height="260px" width="265">
</div>
<div class="vr"> </div>
<div id="desc">
Photography studio management software that helps grow your business, frees up your time, automatically keeps in touch with your clients and makes sure all your jobs stay on track! Studio Ninja reminds you when tasks are due and keeps all your jobs on track and consistent. Just set it up once and never forget a thing again. Check out which jobs are coming up from one convenient location or easily integrate it with Google Calendar or iCalendar. Photography studio management software that helps grow your business, frees up your time, automatically keeps in touch with your clients and makes sure all your jobs stay on track! Studio Ninja reminds you when tasks are due and keeps all your jobs on track and consistent. Just set it up once and never forget a thing again. Check out which jobs are coming up from one convenient location or easily integrate it with Google Calendar or iCalendar.
</div>
</div>
</body>
</html>
autoadjust'height'其中'div'? –
我想调整主divcorcorners2的高度。 –
调整到哪个“高度”?看到这里是** [DEMO](https://jsfiddle.net/Guruprasad_Rao/6s2g0h2m/)**我已经使用你的代码创建了..你能告诉我什么应该是'div'的高度' ? –