爲了澄清我Photoshop處理所需的結果:透明膠盒CSS
我希望背景圖像覆蓋整個屏幕,文本將接近底部。
我想要一個透明的盒子,所以我可以把文本放在裏面。我在網上查了一下,但是我想要背景被固定和縮放以適應背景。另外我希望背景圖像的部分在框中顯示時是透明的,而不是框中的文字。這裏是我想出了迄今爲止代碼:
HTML:
<body>
<div class="background"> // I don't know if its even needed to include this
<div class="transbox">
<p> Text here.
</p>
</div>
</div>
</body>
CSS:
background.div {
background: url(myimage.jpg) no-repeat center center fixed;
webkit-background-size: cover;
moz-background-size: cover;
o-background-size: cover;
background-size: cover;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'images/'.$pic.'Bg.jpg\', sizingMethod=\'scale\');
-ms-filter: \"progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'images/'.$pic.'Bg.jpg\', sizingMethod=\'scale\')\
background-repeat: no-repeat;
color: white;
font-family: Helvetica;
div.transbox {
background-color: #ffffff;
border: 1px solid black;
opacity:0.6;
filter:alpha(opacity=60); /* For IE8 and earlier */
}
div.transbox p {
position: fixed;
bottom: 0;
width:100%;
text-align: center;
font-size: 65px;
-webkit-text-stroke-width: 3px;
-webkit-text-stroke-color: black;
color: white;
}
我不明白你的問題。你只是想要一個沒有背景的常規文本「框」? – Matthias 2014-10-07 10:06:15
這應該是什麼樣子的圖像(包含文本)會很有用。 – 2014-10-07 10:07:08
它會真的幫助,如果你可以photoshop所需的結果圖片,因爲我似乎無法理解你想達到什麼... – Banana 2014-10-07 10:07:13