我正在建立一个网页,它应该适应所有的决议。 我认为对于我定义每个元素的百分比,页面将打开不同的分辨率元素将相对于页面大小。 如果我错了,我不知道有多准确或正确,请纠正我。 因为我以百分比为单位处理大小。 我在div(#thirdLine)中有一个大于图像高度的徽标图像。 而我想通过CSS调整图像的高度div div可能吗? 如果这是不可能的。我在jQuery $('#logo').css('height',$('div.thirdLine').css('height');
中有代码,但不起作用。 你是什么建议我做的感谢。 see example高度图像不匹配div在不同的分辨率
CSS代码:
#thirdLine{
background-image:url('http://www.centerwow.com/linkguide/guide_files/pic/bacround_lineYellow.png');
background-repeat:repeat;
border-color: #316897;
border-radius: 4px 4px 4px 4px;
border-style: solid;
border-width: 1px 1px 1px 1px;
line-height: 7px;
height:25%;
color: #745B1B;
font-family: 'CarterOneRegular';
font-size: 25px;
line-height: 34px;
margin: 0;
padding: 0;
text-shadow: 2px 2px 0 #FFF0D8;
width: auto;
}
#logo{
border-color: #316897;
border-radius: 4px 4px 4px 4px;
border-style: solid;
border-width: 1px 1px 1px 1px;
float:left;
}
的html代码:
<div id="thirdLine"><img id="logo" src="http://www.centerwow.com/linkguide/guide_files/pic/Notebook.png" alt="Link Guide" />this is div id thirdLine</div>