我想用CSS水平對齊兩個圖像。在CSS中,我有:在CSS中對齊兩個圖像
#poster1 {
background-image: url(audioMaster1.png);
background-repeat: no-repeat;
background-position: 0px 40px;
padding-top:595px;
}
#poster2 {
background-image: url(audioMaster2.png);
background-repeat: no-repeat;
background-position: 0px 0px;
padding-top:595px;
}
和HTML,我都不得不時刻:
<div id="poster1"></div>
<div id="poster2"></div>
但是,很明顯,這些圖像都低於對方,我不想要的。我希望圖像並排。
你能多解釋一下alex?我不認爲你所說的解決了我的問題。我的問題是圖像垂直平鋪而不是水平平鋪。 – AJW
@James檢查小提琴...是你想要的嗎? – alex
@james你需要給我們關於圖像的一些信息,你是什麼意思的平鋪,因爲你有'background-repeat:no-repeat;'btw真棒名字;) –