0
所以我有一個頁眉設置爲我的頁面上的100%寬度,我想在橫幅上放置文本並保持原位,但是當我放大和縮小文本更改的位置時。我如何製作它以便文本保持在我設置的位置,放大和縮小不影響它?如何在100%寬度div上對齊文本?
HTML
<div id="wrap">
<div class="right">
Hey <br />
What is up <br />
</div></div>
CSS
* {
margin: 0 auto;
}
#wrap {
height: 150px;
width: 100%;
background: url(http://froggyadventures.com/wp-content/uploads/galleries/post-93/full/placeholder%20-%20Copy%20(2).gif) no-repeat center;
text-align: center;
background-color: #FFF;
}
.right{
width: 400px;
height: 110px;
position: relative;
z-index: 999;
top: 100px;
left: 100px;
}
爲什麼你使用'.right'? http://jsfiddle.net/5ASJv/1/ –
我同意。外星人先生。文本無法對齊時,在div右邊 –