简体   繁体   English

div中的图像与其他图像的高度不同

[英]Image inside a div to be a different height than the rest

I'm struggling to set an img's height inside a div to be taler than the other img's on the rest of my site, can anyone advise, thanks 我正在努力将img中的img的高度设置为比我网站其余部分的其他img的更合适,任何人都可以提出建议,谢谢

Here is the HTML 这是HTML

<div class="project">

    <img src="../../../Images/Nu Space/Nu Space LH.jpg" alt="Nu Space LH" class="image" height="auto" width="580">

    <img src="../../../Images/Nu Space/Nu Space BC.jpg" alt="Nu Space BC" class="image" height="auto" width="580">

    <div class="clear"></div>
</div>

Here is the CSS 这是CSS

img {
    float: right;
    margin-top: 0px;
    height: auto;
}

img li {
    margin-top: 75px;
    height: 100%;
    width: 100%;
}

.project {
    width: 700px;
    min-height: 100%;
    margin-left: 10px;
    margin-right: 0px;
    margin-bottom: 30px;
    left: auto;
    background-color: #FFF;
}

Any help would be appreciated 任何帮助,将不胜感激

div > img {
    width: (desired width in %);
    height: (desired height in %):
}

Edit: Sorry I was not exact in my explanations, but this will change only the images inside a div, which was what the author wanted. 编辑:对不起,我的解释不确切,但这只会更改div中的图像,这正是作者想要的。 I believe he has other images on the webpage, which should have different size. 我相信他在网页上还有其他图片,它们的大小应该不同。

try this one, 试试这个

.project 
{
    width: 700px;
    min-height: 100%;
    margin-left: 10px;
    margin-right: 0px;
    margin-bottom: 30px;
    left: auto;
    background-color: #FFF;
}
.project .image1 
{
    width:200px;
    height: 200px;
}

http://jsfiddle.net/tT8JH/2/ http://jsfiddle.net/tT8JH/2/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM