我見過這個問題有很多不同的方法,但我只是不明白答案,因爲應用程序或場景似乎與我的不同。當div超過我的內容寬度時,我該如何防止水平滾動條出現?
基本上我有一個940px的內容寬度,我想使用一個'畫架'作爲我的幻燈片的背景,但畫架圖片延伸大約400px PAST 940px的內容寬度,導致水平滾動條顯示在940px +畫架寬度(400px) - 但我想要滾動條只顯示當內容是940px或更少 - 是否有一個簡單的修復即時通訊俯瞰?
<div id="showcase">
<div class="content">
<div class="left">
<h1>Lidya Aaghia Tchakerian</h1>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
</p>
</div>
<div id="slideshowArea">
<div id="slideshow">
<ul class="bjqs">
<li><img src="images/slider1.jpg" width="326" height="534" alt="" /></li>
<li><img src="images/slider1.jpg" width="326" height="534" alt="" /></li>
<li><img src="images/slider1.jpg" width="326" height="534" alt="" /></li>
<li><img src="images/slider1.jpg" width="326" height="534" alt="" /></li>
</ul>
</div>
</div>
</div>
</div>
我的CSS:
/* showcase
------------------------------------------*/
#showcase {
position: relative;
padding: 40px 0 0 0;
height: 828px;
background: #fafafa;
border: 1px solid #d8d8d8;
}
#showcase .left {
position: absolute;
width: 388px;
top: 200px;
text-align: center;
}
#showcase .left h1 {
color: #cd6d6d;
}
#slideshowArea {
position: absolute;
width: 824px;
left: 495px;
height: 875px;
background: url('../images/easel.png') no-repeat;
}
#slideshow {
display: block;
position: relative;
left: 72px;
height: 534px;
width: 326px;
border: none;
top: 107px;
}
#slideshow ul {
position: relative;
z-index: 99;
width: 326px;
}
ul .traits {
padding: 0;
float: left;
margin: 10px 0 0 30px;
}
.traits li {
color: #fff;
float: left;
display: block;
margin-right: 25px;
padding: 6px 0 0 22px;
background: url('../images/checkbox.png') no-repeat 0 0;
height: 30px;
list-style: none;
}
任何及所有的幫助深表感謝。
感謝, 彌敦道
編輯:查看頁面訪問http://www.digicrest.com/lidya
如果我理解正確的,可以」你只是重新調整背景圖像的大小? – Wahtever
我不這麼認爲 - 背景圖像必須放置在確切尺寸的「確切」位置,這超出了940像素的內容寬度。 – SYAWEDIS
如果它是一個靜態圖像,您可以使用像PAINT.NET一樣的照片編輯器調整它的大小,如果它是動態的,您可以使用[background-size](http://www.w3。org/TR/css3-background /#the-background-size)屬性。 – Wahtever