【发布时间】:2016-11-29 20:26:11
【问题描述】:
我有一个带有图像的标题和一个用于移动导航菜单的“汉堡包”图标。我只是想在可用屏幕的大约 75% 处显示我的徽标,最右边的菜单图标。
我有一个主 div 容器,然后在其中我有 2 个 div,左侧 div 中有徽标,右侧有菜单图标。由于某种原因,我无法让菜单留在同一个 div 容器中的右侧。有什么建议吗?
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style>
#container {
width: 100%;
max-width: 100%;
border: 0px;
margin: 0px;
padding: 10px;
background-color: blue;
}
#logoContainer {
width: 75%;
max-width: 75%;
border: 0px;
margin: 0px;
background-color: blue;
}
#logo {
width: auto;
max-width: 90%;
min-width: 90%;
}
#menu {
float: right;
}
#mobileMenu {
width: 100%;
background-color: green;
color: white;
display: none;
}
</style>
</head>
<body>
<div id="container">
<div id="logoContainer">
<img id="logo" src="content/logo.png"/>
</div>
<div id="menu">
<button type="button"><span>Menu</span></button>
</div>
</div>
<div id="mobileMenu">some content</div>
</body>
</html>
【问题讨论】:
标签: html css responsive-design