2012-08-07 252 views
1

我需要将我的网站的背景图像设置为此图片。如何在浏览器上调整图片大小

enter image description here

然而,当我看网页,我看到页面上的空白如下图所示:

enter image description here

我想要的图片覆盖整个空间,而当我在任何电脑上打开网站都必须显示相同的内容。最后,我无法在图像中心的中间部分写文字。不在顶部,而是在图片的中间位置。以下是我迄今为止

enter image description here

我需要在中间部分的页面上这段文字。不在页面的高部分,而是在中间。这里是简短的代码片段,我到目前为止有:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ka-ge" lang="ka-ge" > 
<head> 
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
</head> 
<style> 
#links { 
    postiton:absolute; 
    margin: 0 auto; 
    width: 4800px; 
    font-size:50px; 
    clear: both; 
    display: block; 
    z-index:-90; 
} 
#test a { 
    float: right; 
} 
a, a:active, a:visited { 
    color: light-blue; 
    a {text-decoration:none;} 
} 
</style> 
<style> 

a {text-decoration:none;} 
</style> 

<body > 


<a href="eng/index.html"><img src ='english.gif' style="float:right" width="90" height="90"> </a> 
<a href="russ/index.html"><img src ='russian.gif' alt="Russian flag" style="float:right" width="90" height="90"/></a> 
<a href="index.html"> <img src="georgian.jpg" style="float:right" width="90" height="90"/></a> 
<img src="11.gif" width="100%" height="100%"/> 
<div id="links"> 

<a href=" index.html " >მთავარი </a> 
&nbsp; 
<a href=" ბაკურიანი.html ">ბაკურიანი </a> 
&nbsp; 
<a href=" გუდაური.html ">გუდაური </a> 
&nbsp; 
<a href=" ზღვა.html ">ზღვა </a> 
&nbsp; 
<a href=" კახეთი.html ">კახეთი </a> 
&nbsp; 
<a href=" სვანეთი.html ">სვანეთი </a> 
&nbsp; 
<a href=" ვარძია.html ">ვარძია </a> 
&nbsp; 
<a href=" ქართლი.html ">ქართლი </a> 
&nbsp; 
<a href=" ძველი_თბილისი.html ">ძველი_თბილისი </a> 
&nbsp; 
<a href=" დაკავშირება.html ">კონტაქტი </a> 
</div> 
</body> 
</html> 
+3

我想你想要CSS'background-image'属性。 – 2012-08-07 09:31:07

+0

以及如何操作?它会工作吗? – 2012-08-07 09:39:01

+0

看看这个很酷的背景说明https://developer.mozilla.org/en-US/docs/CSS/background-image – Onheiron 2012-08-07 09:52:21

回答

1

我已经在你的代码如下做了一些修改:

</head> 
< style> 
#links { 

position:absolute; 
margin: 0 auto; 
top: 50%;  //centers vertically 
left: 50%;  //centers horizontally 
width: 4800px; 
font-size:50px; 
clear: both; 
display: block; 
z-index:-90; 
} 

...

和body标签还有:

<body background="11.gif"> 

高于体温标签在后台设置你的形象。您可以调整图像大小,即使用< img>标签中的“高度”和“宽度”属性来拉伸或压缩它们以设置其大小。 现在,您可以在背景图片上放置任何文字,链接或其他图片。

试试吧!

相关问题