English 中文(简体)
当浏览器的大小低于网花的大小时,如何阻止儿童潜逃?
原标题:How can i stop a child div moving towards left when browser size becomes less than webPage size?
  • 时间:2011-10-28 10:52:35
  •  标签:
  • html
  • css

I have this html code:

 <div id="maincontent">

        <div id="mainbackground"><img src="images/mainbackground.png" border="0" alt=""></div>
        <div id="illustration"><img src="images/illustration.png" border="0" alt="">

            <div id="text1" class="sloganfont">Mahmood</div>

        </div>

    </div>

c 这些干s为:

 #maincontent
 {
background:#CFCFCF;
width:100%;
height:1200px;
position:relative;
text-align:center;
margin:0 auto;
 }
 #mainbackground{
position:relative;
top:-10px;
 }
 #illustration
 {
position:relative;
top:-768px;
text-align:center;
margin:0 auto;
 }
 #text1{
height: 25px;
width:300px;
background:none;
position:relative;
top:-503px;
left:-268px;
text-align:left;
margin:0 auto;
 }

一、增加我的浏览量。 然后,插图四和正文一四仍然处于中心地位,工作罚款。 但是,如果在原页宽度之后减少我的浏览器,那么插图就停止移至左边,而正文1则将四舍五入。 我想,案文1将四舍五入到探索者宽度低于像插图四那样的网膜。 如何做到这一点? 提前感谢。

最佳回答

你们需要具体指明在适当地方的宽度,所有要素都以类似的方式做出回应,但由于你相对定位第1号正文,在屏幕尺寸小于该数额时,便会打折扣。

here s an example of it working: http://jsfiddle.net/davetayls/GgzUR/

Move the sliders to make the right area wider and smaller

问题回答

我将假设这一点,因为案文1有具体规定的宽度,试图对其他内容 w。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签