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右边 –