清理样式表中的img的左右部分。

问题描述 投票:0回答:2

我想知道如何使div中的图片有一个清晰的leftright?

PHP有图片和文字,而图片必须有一个清晰的leftright才好看。不,我不能在PHP文件中这样做,已经问过老师了:)

我的HTML是这样的。

<div class="four columns" id="weather">
    <h2>Text</h2>
   <?php include 'yr.php'; ?>
</div>

#weather.four.columns是正确的,我想我可以用img#weather.four.columns来解决这个问题,但是没有。

#weather.four.columns {
    border-left:none;
    box-sizing:border-box;
    -moz-box-sizing:border-box;
    -webkit-box-sizing:border-box;
    border-right:1px solid #c4effe;
}

img#weather.four.columns {
    clear:both;

}

有什么建议吗?

css image stylesheet
2个回答
1
投票

试试

#weather img
{
clear:both;
}

0
投票

变化

img#weather.four.columns {
    clear:both;
}

#weather img{ /*this line */
    clear:both;
}

你所做的是试图找到一个id为的图片。weather. 你要的是 weather 身份证找 img 里面的标签。你只是把它反过来了 :)

© www.soinside.com 2019 - 2024. All rights reserved.