2012-05-22 54 views
0

Hihi,我即将推出即将推出的游戏即将推出的网站,我一直在为此奋斗了好几个小时! http://endlessreturn.com/是网站,基本上,无论如何,我可以得到“查看预告片”比较接近实际预告片吗?让位置靠近中心的css?

IMG.logo { 
    display: block; 
    margin-left: auto; 
    margin-right: auto } 

IMG.copyright { 
    display: block; 
    margin-left: auto; 
    margin-right: auto } 

.center 
{ 
margin-left:auto; 
margin-right:auto; 
width:100%; 
display: block; 
background-image:url('/images/trailer.png'); 
background-repeat:no-repeat; 

background-position:right; 
} 

img.floatLeft { 
    float: left; 
    margin: 4px; 
} 

body 
{ 
background-image:url('/images/bg.gif'); 
background-repeat:repeat-x; 
} 


#wrapper { 
    width: 467px; 
    margin: 29px auto; 
    } 
#logo { 
    height: 397px; 
    text-indent: -10000px; 
    margin-bottom: -135px; 
    } 

#form { 
    width: 700px; 
    margin: 25px auto 15px auto; 
    } 
form { 
    background: url(/images/newsletter.png) no-repeat; 
    height: 90px; 
    } 
input { 
    background: none; 
    border: none; 
    outline: 0; 
} 
input.text { 
    width: 400px; 
    height: 75px; 
    padding: 0px 0px 30px 90px; 
    color: #505050; 
    font-size: 16px; 
    float: left; 
    } 
input.submit { 
    width: 165px; 
    height: 60px; 
    padding: 50px 0 13px 10px; 
    float: right; 
    cursor: pointer; 
    }.center iframe { 
    text-align: center; 
    float: none; 
} 



<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Endless Return - 2D MMORPG</title> 
<LINK REL=StyleSheet HREF="style.css" TYPE="text/css" MEDIA=screen> 
</head> 
<body> 

<IMG class="logo" src="/images/logo.png" alt="logo"> 
<div class="center"> 
<center><iframe src="http://www.youtube.com/embed/2IMOh6JAJkY" width="640" height="360" frameborder="0" allowfullscreen></iframe></center> 

</div> 
</div> 
<IMG class="copyright" src="/images/copyright.png" alt="logo"> 
</body> 
</html> 
+0

你能给我们一些代码吗? – Sajmon

+0

@Sajmon完成:) – Spike

回答

0

您的形象和你CSS需要调整。

您需要将图像放大一些,使其能够以当前的背景div为中心,并在视频旁边放置箭头和文字。

参见本实施例中与1280px图像: enter image description here

这个例子中相对于视频的宽度使用图像足够宽。

修订版CSS:

.center { 
    background-image: url("/images/trailer.png") 
    background-position: center center; 
    background-repeat: no-repeat; 
    display: block; 
    margin-left: auto; 
    margin-right: auto; 
    width: 100%; 
} 

和链接to the imagewidth 1280px。

+0

非常感谢你! – Spike

0

而不是右中心,使用x%y%第一个值是水平位置,第二个值是垂直位置。左上角是0%0%。右下角是100%100%。如果您只指定一个值,另一个值将为50%。 。默认值是:0%0%