Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/16.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.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
Css 位置:绝对div在位置:相对内消失_Css - Fatal编程技术网

Css 位置:绝对div在位置:相对内消失

Css 位置:绝对div在位置:相对内消失,css,Css,我对CSS比较陌生,在我的页面布局中,我面临以下问题 我看过其他帖子,但没有找到答案。问题是当我指定 位置:绝对在logo logoimg内,不加载。但是如果我删除 位置:绝对标识已正确加载。我正在努力学习如何定位潜水艇 在相对div中创建绝对div 我的html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

我对CSS比较陌生,在我的页面布局中,我面临以下问题

我看过其他帖子,但没有找到答案。问题是当我指定

位置:绝对在logo logoimg内,不加载。但是如果我删除

位置:绝对标识已正确加载。我正在努力学习如何定位潜水艇

在相对div中创建绝对div

我的html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>New Web Project</title>
        <link rel="stylesheet" href="style.css" type="text/css" media="screen"  charset="utf-8"/>
    </head>
    <body>
        <div id = "wrapper">
            <div id = "header"> <img  src="images/banner.png" /> </div>
            <div id = "content">
                <div id="logo">
                    <div id="logoimg" > czcz </div>
                </div>
            </div>
        </div>
    </body>
</html>

整洁地摆弄猴子供你玩:

整洁地摆弄猴子供你玩:

对logo和logoimg应用z-index:1是个好主意吗?我不认为soHm,你在看哪个浏览器和版本,因为当前的firefox似乎没有这个问题。对logo和logoimg应用z-index:1是个好主意吗?我不认为soHm,你在看哪个浏览器和版本,因为当前的firefox似乎没有这个问题。。。图片在aptana studio previewer中超出了边界…谢谢你得到它:。。。图像在aptana studio previewer中超出了边界。。。
body {
  margin: 0;
  padding: 0;
}


#header {
    background: url('images/banner_tile.jpg') ;
    height: 96px;
    width: 100% ;
}

#header img {
    display:block;
    margin: auto ;
}

#content img {
    display:block;
    margin: auto ;
}

#content {
    /*overflow:auto ;*/
    background: url('images/body_tile.png') ;
    height: 100% ;  
    width: 100%  ;
}

 #logo { position:relative; height: 100px ; }

 #logo #logoimg {
    position:absolute ; 
    top:300px ;
    left:700px ;
    width:398px ;
    height:200px ;
    background: url('images/body_sprite.png');
    z-index: 1;
 }