- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我知道这个问题已经得到解答,但我不明白为什么我的 div 会重叠。今天早些时候,标题与导航栏重叠,现在容器与标题和导航栏重叠。
这就是它的样子 -> http://i.imgur.com/pqeyZUx.png
CSS 和 HTML
@font-face {
font-family: 'HaloOutline';
src: url('/core/HaloOutline.ttf') format('truetype');
}
sup {
font-size:14px; font-family:HaloOutline!important;
}
/* Dropdown Button */
.dropbtn {
cursor: pointer;
}
#showUser {
display:none; position:relative; z-index:100; background:#1b272c; opacity: 0.5;
}
body
{
min-height:100%;
background-color: #131416 ;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
.dialog { display:none; }
.wrapper {
display: flex;
flex-direction: column;
}
#container {
width: 80%;
display: flex;
margin: 0px auto;
background: #1c1e21;
opacity: 0.9;
}
/* NAVIGATION section ====================== */
.navbar {
display: flex;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#1c1e21+0,2f3237+50,26282c+51,383c42+100 */
background: #1c1e21;
/* Old browsers */
background: -moz-linear-gradient(top, #1c1e21 0%, #2f3237 50%, #26282c 51%, #383c42 100%);
/* FF3.6-15 */
background: -webkit-linear-gradient(top, #1c1e21 0%, #2f3237 50%, #26282c 51%, #383c42 100%);
/* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, #1c1e21 0%, #2f3237 50%, #26282c 51%, #383c42 100%);
/* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#1c1e21', endColorstr='#383c42', GradientType=0);
/* IE6-9 */
height: 15px;
width: 80%;
max-width: 80%;
font-weight: bold;
letter-spacing: 0.1em;
margin: auto;
}
.navbar ul {
list-style-type: none;
text-align: center;
margin: auto;
padding: 6px;
min-width: 100%;
}
.navbar > ul > li {
min-width: 25%;
text-align: center;
}
.navbar > ul > li > ul {
display: none;
}
.navbar > ul > li:hover > ul {
display: block;
}
.navbar ul li a {
text-decoration: none;
font-family: Arial;
padding: .2em 1em;
color: #bcc1c7;
}
.navbar ul li a:hover {
border: solid 1px #5d646f;
color: #858c99;
background-color: #2e3238;
border-top-right-radius: .2em;
border-bottom-left-radius: .2em;
}
/* HEADER section ========================== */
header {
height: 200px;
width: 100%;
color: white;
background-image: url("http://vignette2.wikia.nocookie.net/halo/images/c/c1/Forge_world.png/revision/latest/scale-to-width-down/2000?cb=20100723045607");
background-position: center center;
position: relative;
transition: background-image 1s ease-in-out;
}
header {
height: 200px;
width: 80%;
margin: 0 auto;
margin-top:2.5%;
color: white;
background-image: url("http://vignette2.wikia.nocookie.net/halo/images/c/c1/Forge_world.png/revision/latest/scale-to-width-down/2000?cb=20100723045607");
background-position: center center;
position: relative;
transition: background-image 1s ease-in-out;
}
header img {
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
position: absolute;
-webkit-transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-o-transition: opacity 1s ease-in-out;
transition: opacity 1s ease-in-out;
}
header:hover {
background-image: url("http://images.gamersyde.com/image_halo_reach-13325-1852_0004.jpg");
}
header img.top:hover {
opacity: 0;
}
aside {
margin-bottom: 20px;
display: flex;
width: 20%;
line-height: 100%;
background: #2e3338!important;
}
aside hr {
width: 90%;
}
aside img {
width: 90%;
}
aside ul {
width: 90%;
text-align: justify;
margin-top: auto;
margin-bottom: auto;
margin-left: -10%;
margin-right: auto;
opacity: 1.0;
padding: 10px;
list-style-type: none;
}
aside ul li {
min-width: 100%;
margin-left: 25%;
margin-right: 25%;
}
aside ul li a {
text-decoration: none;
font-family: Arial;
color: #bcc1c7;
}
aside ul li a:hover {
color: #25282c;
padding: 4px;
background-color: #c7cbd1;
}
aside h3 {
background: #202020;
text-align: center;
color: white;
}
/* MAIN ========================================= */
main
{
float: left;
display:block;
width: 77%;
color: white;
font-family: Arial;
font-size: 16px;
padding:10px;
border-bottom-right-radius:1em;
}
main a {
text-decoration: none;
color:grey;
}
main a:hover {
text-decoration:none;
color: #60808F;
}
hr {
border-color: #25282c;
width: 760px;
}
p {
margin: 20px;
color: #bcc1c7;
}
j {
margin: 1px;
color: #bcc1c7;
}
article {
background: url("img/Panellong.png");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
padding: 20px;
}
h2 {
text-align: center;
color: #bcc1c7;
letter-spacing: 0.1em;
}
h1 {
text-align: center;
color: #bcc1c7;
letter-spacing: 0.1em;
}
img {
max-width: 100%;
max-height: 100%;
display: block;
margin-left: auto;
margin-right: auto;
}
/* FOOTER ========================================= */
#footer {
clear:both;
color: #bcc1c7;
text-align: center;
border-top:1px dashed grey !important;
margin-top: 40px;
border-bottom-left-radius:1em;
border-bottom-right-radius:1em;
padding: 15px;
font-size: 90%;
font-family: Arial;
background-color: #2e3338;
max-width: 100%;
position:relative;
bottom:0;
left:0;
right:0;
}
#footer a {
text-decoration: none;
color:grey;
}
#footer a:hover {
text-decoration:none;
color: #60808F;
}
fieldset {
padding: 20px;
margin: 20px 0;
border: 1px solid #5d646f;
}
legend {
padding: 10px;
font-size: 18px;
letter-spacing: 0.1em;
color: #bcc1c7;
}
input[type="password"],
input[type="username"],
input[type="name"],
input[type="email"],
input[type="age"],
input[type="text"]{
display: block;
margin-bottom: 20px;
padding: 10px 10px 10px 25px;
border: 0;
border-radius: 3px;
background-color: #25282c;
color: #fff;
width: 300px
}
textarea {
display: block;
padding: 10px 10px 10px 25px;
border: 0;
border-radius: 3px;
background-color: #25282c;
color: #fff;
width: 70%;
height:200px;
}
label {
padding: 5px;
font-size: 14px;
letter-spacing: 0.1em;
color: #bcc1c7;
}
input[type="submit"],
input[type="button"],
button {
border: solid 1px #5d646f;
background: #25282c;
width:150px;
height: 30px;
border-top-right-radius: 1em;
border-bottom-left-radius: 1em;
letter-spacing: 0.1em;
color: #bcc1c7;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Halo Editing Community</title>
<link type="text/css" rel="stylesheet" href="/core/style.css" />
<link rel="stylesheet" href="//halovau.lt/js/vader-jquery-ui.css" />
<script src="//halovau.lt/js/jquery-3.1.0.js"></script>
<script src="//halovau.lt/js/jquery-3.1.0.min.js"></script>
<script src="//halovau.lt/js/jquery-ui.js"></script>
<script src="//cdn.jsdelivr.net/fingerprintjs2/1.4.1/fingerprint2.min.js"></script>
<script>
<!--
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
//-->
</script>
</head>
<body>
<div class='dialog' id='dialog0' title='Allied Websites'>
<center><a href='//halovau.lt'><b>HaloVault</b></b><img src='https://cdn.discordapp.com/attachments/227232976763748355/237104871386513409/halovauliconSAFE3.png' width='50%' alt='HALO VAULT' title='HaloVault' /></a>
<a href="http://www.xboxchaos.com"><b>Xbox Chaos</b><img alt="" border="0" src="http://i.imgur.com/gelB8qc.png" /> </a>
<br />
<a href="http://www.macgamingmods.com"><b>Mac Gaming Mods</b><img alt="" border="0" src="http://i.imgur.com/CzwS1LZ.png" /> </a>
<br />
<a href="http://www.halo3archives.com"><b>Halo 3 Archives</b><img alt="" border="0" src="https://halo3archives.com/images/banner.jpg" />
<br /></center>
</div>
<?php if (!isset($_USER['id'])) {$staff = "<li><a href=\"/application.php\">Recruitment</a></li>";}
elseif (isset($_USER['id']) OR isset($_SESSION['uname'])) {
$panel=''; if ($_USER['group'] > 1){ $panel = "<a href='/leg3ndary'>♛ Staff Panel</a><br />"; }
$staff = "<li><a href='javascript:void();' class='uClick' onclick=\"toggle_visibility('showUser')\" class='dropbtn'>".$_USER['name']." ▼</a>\n"
."<div id='showUser''><center><img title='Click to view your profile.' style='cursor:pointer;' onclick=\"location.href='/members.php?id=".$_USER['id']."';\" width='110' src=\"".$_USER['img']."\" /><br />\n
<a href='/articles.php?new=link'>☲ Submit Download</a><br />\n
<a href='/articles.php?new=tutorial'>☲ Submit Tutorial</a><br />\n
".$panel."\n
<a href='/logout.php'>🔒 Logout</a></center></li></div>";
} ?>
<div class="wrapper">
<div class="navbar">
<ul class="navbar">
<li><a href="/index.php">Home</a>
</li>
<li><a href="/members.php">Members</a>
</li>
<li><a href="/archive.php">Archive ▼</a>
<ul>
<li><a href="#">Community Portal</a>
</li>
<li><a href="#">Blog Posts</a>
</li>
<li><a href="#">Mod/Map Downloads</a>
</li>
</ul>
</li>
<?=$staff;?>
</ul>
</div>
<header>
<img class="bottom" src='/core/img/logolight.png' />
<img class="top" src='/core/img/logo.png' />
</header>
<div id="container">
<aside>
<ul>
<br />
<?php if(!isset($_USER[ 'id'])) { ?>
<li><a href="login.php">Login Page</a>
</li>
<?php } ?>
<br />
<li><a class='dialog_link' data-dialog='dialog0' href="javascript:void();">Allied Websites</a>
</li>
<br />
<li><a href="changelog.php">Change Log</a>
</li>
<br />
<li><a href="/articles.php?cat=tutorials">Getting Started</a>
</li>
<br />
</ul>
<br />
</aside>
</div>
<?php require_once "core/structure.php"; include_once "core/top.php"; ?>
<main>
<article>
<h2>Halo Editing Community<sup>alpha</sup></h2>
</article>
<br /><br /><p>Welcome to the Halo Editing Community, a place where we preserve and archive the beauty of Halo as it lasted under it's original founders Bungie. Here you can find all sorts of Halo mods, tips and tutorials. </p>
<br />
<br />
<hr />
<img src="https://s16.postimg.org/ywmshllmd/framed.png">
<h2>
Holiday Cards
</h2>
<p>
"Wake up! The enemy!" - To other Grunts.
</p>
</main>
<?php include_once "core/bottom.php"; ?>
最佳答案
您可以使用 display:flex 代替 float 布局。检查这个片段
@font-face {
font-family: 'HaloOutline';
src: url('/core/HaloOutline.ttf') format('truetype');
}
sup {
font-size: 14px;
font-family: HaloOutline!important;
}
/* Dropdown Button */
.dropbtn {
cursor: pointer;
}
#showUser {
display: none;
position: relative;
z-index: 100;
background: #1b272c;
opacity: 0.5;
}
body {
min-height: 100%;
background-color: #131416;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
.dialog {
display: none;
}
.wrapper {
display: flex;
flex-direction: column;
}
#container {
width: 80%;
display: flex;
margin: 0px auto;
background: #1c1e21;
opacity: 0.9;
}
.navbar-container {
position:relative;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#1c1e21+0,2f3237+50,26282c+51,383c42+100 */
background: #1c1e21;
/* Old browsers */
background: -moz-linear-gradient(top, #1c1e21 0%, #2f3237 50%, #26282c 51%, #383c42 100%);
/* FF3.6-15 */
background: -webkit-linear-gradient(top, #1c1e21 0%, #2f3237 50%, #26282c 51%, #383c42 100%);
/* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, #1c1e21 0%, #2f3237 50%, #26282c 51%, #383c42 100%);
/* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#1c1e21', endColorstr='#383c42', GradientType=0);
/* IE6-9 */
height: 25px;
width: 80%;
max-width: 80%;
letter-spacing: 0.1em;
margin: auto;
padding:5px;
}
ul.navbar {
display: flex;
list-style-type: none;
text-align: center;
margin: auto;
min-width: 100%;
}
ul li{
letter-spacing: 0.1em;
font-weight:bold;
text-decoration:none;
}
ul.navbar > li {
min-width: 25%;
text-align: center;
}
ul.navbar > li > ul {
list-style-type:none;
display: none;
position:absolute;
right:10;
z-index:1;
}
ul.navbar > li:hover > ul {
display: block;
padding:10px;
}
.navbar li a {
text-decoration: none;
font-family: Arial;
padding: .2em 1em;
color: #bcc1c7;
}
.navbar ul li a:hover {
border: solid 1px #5d646f;
color: #858c99;
background-color: #2e3238;
border-top-right-radius: .2em;
border-bottom-left-radius: .2em;
}
/* HEADER section ========================== */
header {
height: 200px;
width: 100%;
color: white;
background-image: url("http://vignette2.wikia.nocookie.net/halo/images/c/c1/Forge_world.png/revision/latest/scale-to-width-down/2000?cb=20100723045607");
background-position: center center;
position: relative;
transition: background-image 1s ease-in-out;
}
header {
height: 200px;
width: 80%;
margin: 0 auto;
color: white;
background-image: url("http://vignette2.wikia.nocookie.net/halo/images/c/c1/Forge_world.png/revision/latest/scale-to-width-down/2000?cb=20100723045607");
background-position: center center;
position: relative;
transition: background-image 1s ease-in-out;
}
header img {
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
position: absolute;
-webkit-transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-o-transition: opacity 1s ease-in-out;
transition: opacity 1s ease-in-out;
}
header:hover {
background-image: url("http://images.gamersyde.com/image_halo_reach-13325-1852_0004.jpg");
}
header img.top:hover {
opacity: 0;
}
aside {
margin-bottom: 20px;
display: flex;
width: 20%;
line-height: 100%;
background: #2e3338!important;
}
aside hr {
width: 90%;
}
aside img {
width: 90%;
}
aside ul {
width: 90%;
text-align: justify;
margin-top: auto;
margin-bottom: auto;
margin-left: -10%;
margin-right: auto;
opacity: 1.0;
padding: 10px;
list-style-type: none;
}
aside ul li {
min-width: 100%;
margin-left: 25%;
margin-right: 25%;
}
aside ul li a {
text-decoration: none;
font-family: Arial;
color: #bcc1c7;
}
aside ul li a:hover {
color: #25282c;
padding: 4px;
background-color: #c7cbd1;
}
aside h3 {
background: #202020;
text-align: center;
color: white;
}
/* MAIN ========================================= */
main {
float: left;
display: block;
width: 77%;
color: white;
font-family: Arial;
font-size: 16px;
padding: 10px;
border-bottom-right-radius: 1em;
}
main a {
text-decoration: none;
color: grey;
}
main a:hover {
text-decoration: none;
color: #60808F;
}
hr {
border-color: #25282c;
width: 760px;
}
p {
margin: 20px;
color: #bcc1c7;
}
j {
margin: 1px;
color: #bcc1c7;
}
article {
background: url("img/Panellong.png");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
padding: 20px;
}
h2 {
text-align: center;
color: #bcc1c7;
letter-spacing: 0.1em;
}
h1 {
text-align: center;
color: #bcc1c7;
letter-spacing: 0.1em;
}
img {
max-width: 100%;
max-height: 100%;
display: block;
margin-left: auto;
margin-right: auto;
}
/* FOOTER ========================================= */
#footer {
clear: both;
color: #bcc1c7;
text-align: center;
border-top: 1px dashed grey !important;
margin-top: 40px;
border-bottom-left-radius: 1em;
border-bottom-right-radius: 1em;
padding: 15px;
font-size: 90%;
font-family: Arial;
background-color: #2e3338;
max-width: 100%;
position: relative;
bottom: 0;
left: 0;
right: 0;
}
#footer a {
text-decoration: none;
color: grey;
}
#footer a:hover {
text-decoration: none;
color: #60808F;
}
fieldset {
padding: 20px;
margin: 20px 0;
border: 1px solid #5d646f;
}
legend {
padding: 10px;
font-size: 18px;
letter-spacing: 0.1em;
color: #bcc1c7;
}
input[type="password"],
input[type="username"],
input[type="name"],
input[type="email"],
input[type="age"],
input[type="text"] {
display: block;
margin-bottom: 20px;
padding: 10px 10px 10px 25px;
border: 0;
border-radius: 3px;
background-color: #25282c;
color: #fff;
width: 300px
}
textarea {
display: block;
padding: 10px 10px 10px 25px;
border: 0;
border-radius: 3px;
background-color: #25282c;
color: #fff;
width: 70%;
height: 200px;
}
label {
padding: 5px;
font-size: 14px;
letter-spacing: 0.1em;
color: #bcc1c7;
}
input[type="submit"],
input[type="button"],
button {
border: solid 1px #5d646f;
background: #25282c;
width: 150px;
height: 30px;
border-top-right-radius: 1em;
border-bottom-left-radius: 1em;
letter-spacing: 0.1em;
color: #bcc1c7;
}
<div class="wrapper">
<div class="navbar-container">
<ul class="navbar">
<li><a href="/index.php">Home</a></li>
<li><a href="/members.php">Members</a></li>
<li><a href="/archive.php">Archive ▼</a>
<ul>
<li><a href="#">Community Portal</a></li>
<li><a href="#">Blog Posts</a></li>
<li><a href="#">Mod/Map Downloads</a></li>
</ul>
</li>
<?=$staff;?>
</ul>
</div>
<header>
<img class="bottom" src='/core/img/logolight.png' />
<img class="top" src='/core/img/logo.png' />
</header>
<div id="container">
<aside>
<ul>
<br />
<?php if(!isset($_USER['id'])) { ?><li><a href="login.php">Login Page</a></li> <?php } ?>
<br />
<li><a class='dialog_link' data-dialog='dialog0' href="javascript:void();">Allied Websites</a></li>
<br />
<li><a href="changelog.php">Change Log</a></li>
<br />
<li><a href="/articles.php?cat=tutorials">Getting Started</a></li>
<br />
</ul>
<br />
</aside>
</div>
</div>
希望对你有帮助
关于html - Div 在 CSS 中重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40813479/
我需要将文本放在 中在一个 Div 中,在另一个 Div 中,在另一个 Div 中。所以这是它的样子: #document Change PIN
奇怪的事情发生了。 我有一个基本的 html 代码。 html,头部, body 。(因为我收到了一些反对票,这里是完整的代码) 这是我的CSS: html { backgroun
我正在尝试将 Assets 中的一组图像加载到 UICollectionview 中存在的 ImageView 中,但每当我运行应用程序时它都会显示错误。而且也没有显示图像。 我在ViewDidLoa
我需要根据带参数的 perl 脚本的输出更改一些环境变量。在 tcsh 中,我可以使用别名命令来评估 perl 脚本的输出。 tcsh: alias setsdk 'eval `/localhome/
我使用 Windows 身份验证创建了一个新的 Blazor(服务器端)应用程序,并使用 IIS Express 运行它。它将显示一条消息“Hello Domain\User!”来自右上方的以下 Ra
这是我的方法 void login(Event event);我想知道 Kotlin 中应该如何 最佳答案 在 Kotlin 中通配符运算符是 * 。它指示编译器它是未知的,但一旦知道,就不会有其他类
看下面的代码 for story in book if story.title.length < 140 - var story
我正在尝试用 C 语言学习字符串处理。我写了一个程序,它存储了一些音乐轨道,并帮助用户检查他/她想到的歌曲是否存在于存储的轨道中。这是通过要求用户输入一串字符来完成的。然后程序使用 strstr()
我正在学习 sscanf 并遇到如下格式字符串: sscanf("%[^:]:%[^*=]%*[*=]%n",a,b,&c); 我理解 %[^:] 部分意味着扫描直到遇到 ':' 并将其分配给 a。:
def char_check(x,y): if (str(x) in y or x.find(y) > -1) or (str(y) in x or y.find(x) > -1):
我有一种情况,我想将文本文件中的现有行包含到一个新 block 中。 line 1 line 2 line in block line 3 line 4 应该变成 line 1 line 2 line
我有一个新项目,我正在尝试设置 Django 调试工具栏。首先,我尝试了快速设置,它只涉及将 'debug_toolbar' 添加到我的已安装应用程序列表中。有了这个,当我转到我的根 URL 时,调试
在 Matlab 中,如果我有一个函数 f,例如签名是 f(a,b,c),我可以创建一个只有一个变量 b 的函数,它将使用固定的 a=a1 和 c=c1 调用 f: g = @(b) f(a1, b,
我不明白为什么 ForEach 中的元素之间有多余的垂直间距在 VStack 里面在 ScrollView 里面使用 GeometryReader 时渲染自定义水平分隔线。 Scrol
我想知道,是否有关于何时使用 session 和 cookie 的指南或最佳实践? 什么应该和什么不应该存储在其中?谢谢! 最佳答案 这些文档很好地了解了 session cookie 的安全问题以及
我在 scipy/numpy 中有一个 Nx3 矩阵,我想用它制作一个 3 维条形图,其中 X 轴和 Y 轴由矩阵的第一列和第二列的值、高度确定每个条形的 是矩阵中的第三列,条形的数量由 N 确定。
假设我用两种不同的方式初始化信号量 sem_init(&randomsem,0,1) sem_init(&randomsem,0,0) 现在, sem_wait(&randomsem) 在这两种情况下
我怀疑该值如何存储在“WORD”中,因为 PStr 包含实际输出。? 既然Pstr中存储的是小写到大写的字母,那么在printf中如何将其给出为“WORD”。有人可以吗?解释一下? #include
我有一个 3x3 数组: var my_array = [[0,1,2], [3,4,5], [6,7,8]]; 并想获得它的第一个 2
我意识到您可以使用如下方式轻松检查焦点: var hasFocus = true; $(window).blur(function(){ hasFocus = false; }); $(win
我是一名优秀的程序员,十分优秀!