【发布时间】:2021-11-09 11:55:04
【问题描述】:
这里是初学者!
我正在为一项任务而苦苦挣扎。 要求为三个不同页面上的所有三个不同图像添加一个具有唯一名称“div=heroimage”的 div ID。但是,它们在每个页面上的位置相同。
CSS 首页、第二页和第三页
#度假村
{
height: 200px;
background-image: url(resort.jpg);
background-size: 100% 100%;
background-repeat: no-repeat;
}
#酒店
{
height: 200px;
background-image: url(hotel.jpg);
background-size: 100% 100%;
background-repeat: no-repeat;
}
#casa
{
height: 200px;
background-image: url(casa.jpg);
background-size: 100% 100%;
background-repeat: no-repeat;
}
其他两个相同,只是ID名称和标题不同。 如果我用“div=heroimage”更改所有三个,那么最好的方法是什么?
【问题讨论】: