Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 图像需要处于相同的位置_Html_Image - Fatal编程技术网

Html 图像需要处于相同的位置

Html 图像需要处于相同的位置,html,image,Html,Image,我试着把这个地球仪图像放在准确的位置,但是当页面不是全屏时,由于某种原因,地球仪图像消失了。我应该做些什么更改以确保当屏幕不是全屏时,图像保持在相同的位置 div.image { content:url(../images/logonew.png); position: absolute; left: 11.4%; top:1%; width: 77px; height: 69px; z-index: -1; repeat:no-repeat;

我试着把这个地球仪图像放在准确的位置,但是当页面不是全屏时,由于某种原因,地球仪图像消失了。我应该做些什么更改以确保当屏幕不是全屏时,图像保持在相同的位置

div.image {
   content:url(../images/logonew.png);

   position: absolute;
   left: 11.4%;
   top:1%;
   width: 77px;
   height: 69px;
   z-index: -1;
   repeat:no-repeat;
}

您的z-index:-1可能是问题的一部分,网页上的大多数内容默认为z-index:0,并且可能会使用z-index:-1覆盖图像

不管怎样,我个人发现对我来说很好的事情是这样的:

 <div style="position:relative">    <!--relative to preceding stuff on web page -->
 <img style="position:absolute" />  <!--absolute with respect to inside the <div> block -->
 <img style="position:absolute" />  <!--obviously you need to specify more style data than shown here! -->
 <!--as many more images as you like, organized to precise locations inside the <div> block-->
 <!--other elements can also be precisely positioned in the <div> block; things like <p> and <span>
     and <input> and <select> and <table> tags can have style data -->
 </div>
 <br />
 <br />
 <!-- use as many line-breaks as needed to reserve enough page-space for the stuff in the <div> block -->
 <br />
 <br />
 <!-- the rest of the web page now begins -->






Give demo link或make jsfiddle
repeat
对于css来说不是有效的样式,我假设你的意思是
background repeat
。我还假设你指的是背景图像,而不是内容,是的