Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.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_Css_List_Web - Fatal编程技术网

Html 添加列表时徽标移出菜单 我希望在我的菜单里有我的标志,在页面中间有一个列表。但只有当我让它浮起来的权利,我的标志是留在我的菜单。。。下面是一个例子:

Html 添加列表时徽标移出菜单 我希望在我的菜单里有我的标志,在页面中间有一个列表。但只有当我让它浮起来的权利,我的标志是留在我的菜单。。。下面是一个例子:,html,css,list,web,Html,Css,List,Web,这可能是有用的: <body> <style> body{ font-family:impact; overflow-y: scroll; background-color:#4A4247; margin:0px; } #Wrapper{ margin:0 auto; width:1000px; } #Menu{ color:#09b800; margin:0 auto; width:1000p

这可能是有用的:

<body>
<style>
   body{
    font-family:impact;
    overflow-y: scroll;
    background-color:#4A4247;
    margin:0px;
}
#Wrapper{
    margin:0 auto;
    width:1000px;
}
#Menu{
    color:#09b800;
    margin:0 auto;
    width:1000px;
    height:150px;
    background-color:#151D04;
}
#Nav ul{
margin:0 auto;

}
#Nav{
width:850px;
margin-left:-75px;
    text-align:center;
    display:table;
    float:left;
}
#Logo{
    clear:right;
    float:left;
    width:150px;
}
#Video{
    width:640px;
    height:360px;
    margin-top:20px;
    float:left;
    background-color:black;
    margin-bottom:20px;
}
#News{
    margin-top:20px;
    width:340px;
    height:360px;
    color:black;
    float:right;
    background-color:black;
    margin-bottom:20px;
}
#Footer{
    clear: both;
    background-color:black;
    height: 100px;
}
</style>
<div id="Wrapper">
<header>
    <div id="Menu">

        <div id="logo">
            <img src="Breaking Bad.png" alt="Logo" height="150px">
        </div>
        <div id="Nav">
            <ul>
                <li><a href="#">Home</a></li>
                <li><a href="#">About Us</a></li>
                <li><a href="#">Contact Us</a></li>
                <li><a href="#">Social</a></li>
            </ul>
        </div>
    </div>
</header>   
<div id="Video"><iframe width="640" height="360" src="http://www.youtube.com/embed/Gx7L8FWN80Y" frameborder="0" allowfullscreen></iframe></div>
<div id="News"></div>
<div id="Footer"></div>
</div>

</body>

身体{
字体系列:影响;
溢出y:滚动;
背景色:#4A4247;
边际:0px;
}
#包装纸{
保证金:0自动;
宽度:1000px;
}
#菜单{
颜色:#09b800;
保证金:0自动;
宽度:1000px;
高度:150像素;
背景色:#151D04;
}
#导航ul{
保证金:0自动;
}
#导航{
宽度:850px;
左边距:-75px;
文本对齐:居中;
显示:表格;
浮动:左;
}
#标志{
清楚:对,;
浮动:左;
宽度:150px;
}
#录像带{
宽度:640px;
高度:360px;
边缘顶部:20px;
浮动:左;
背景色:黑色;
边缘底部:20px;
}
#新闻{
边缘顶部:20px;
宽度:340px;
高度:360px;
颜色:黑色;
浮动:对;
背景色:黑色;
边缘底部:20px;
}
#页脚{
明确:两者皆有;
背景色:黑色;
高度:100px;
}
我将HTML和CSS合并在一起,

将float左移到#Nav和#Logo,静态宽度,带负边距。阅读代码,您会注意到诀窍。

这是不完整的css/html,请创建一个JSFIDLE
    body{
    font-family:impact;
    overflow-y: scroll;
    background-color:#4A4247;
    margin:0px;
}
#Wrapper{
    margin:0 auto;
    width:1000px;
}
#Menu{
    color:#09b800;
    margin:0 auto;
    width:1000px;
    height:150px;
    background-color:#151D04;
}
#Nav{
    text-align:center;
    margin:0 auto;
    display:table;

}
#Logo{
    clear:right;
    float:left;
}
#Video{
    width:640px;
    height:360px;
    margin-top:20px;
    float:left;
    background-color:black;
    margin-bottom:20px;
}
#News{
    margin-top:20px;
    width:340px;
    height:360px;
    color:black;
    float:right;
    background-color:black;
    margin-bottom:20px;
}
#Footer{
    clear: both;
    background-color:black;
    height: 100px;
}
<body>
<style>
   body{
    font-family:impact;
    overflow-y: scroll;
    background-color:#4A4247;
    margin:0px;
}
#Wrapper{
    margin:0 auto;
    width:1000px;
}
#Menu{
    color:#09b800;
    margin:0 auto;
    width:1000px;
    height:150px;
    background-color:#151D04;
}
#Nav ul{
margin:0 auto;

}
#Nav{
width:850px;
margin-left:-75px;
    text-align:center;
    display:table;
    float:left;
}
#Logo{
    clear:right;
    float:left;
    width:150px;
}
#Video{
    width:640px;
    height:360px;
    margin-top:20px;
    float:left;
    background-color:black;
    margin-bottom:20px;
}
#News{
    margin-top:20px;
    width:340px;
    height:360px;
    color:black;
    float:right;
    background-color:black;
    margin-bottom:20px;
}
#Footer{
    clear: both;
    background-color:black;
    height: 100px;
}
</style>
<div id="Wrapper">
<header>
    <div id="Menu">

        <div id="logo">
            <img src="Breaking Bad.png" alt="Logo" height="150px">
        </div>
        <div id="Nav">
            <ul>
                <li><a href="#">Home</a></li>
                <li><a href="#">About Us</a></li>
                <li><a href="#">Contact Us</a></li>
                <li><a href="#">Social</a></li>
            </ul>
        </div>
    </div>
</header>   
<div id="Video"><iframe width="640" height="360" src="http://www.youtube.com/embed/Gx7L8FWN80Y" frameborder="0" allowfullscreen></iframe></div>
<div id="News"></div>
<div id="Footer"></div>
</div>

</body>