导航菜单下方未显示文本
Text not displaying below Navigation Menu
all.我在CSS和HTML方面遇到了更多麻烦。我不确定我做错了什么,但我的 h1 文本不想出现在我的导航菜单栏下方。我尝试设置像素的次数越多,它移动的越多,并带来了导航菜单栏。我对这一切很陌生,你们有什么建议可以给我的吗?
*{
margin:0px;
padding:0px;
}
body{
background:url(../images/background.jpg);
height:100%;
width:100%;
}
#container{
margin-top:10px;
margin-left:710px;
}
.menu{
list-style:none;
}
.menu li{
display:block;
height:50px;
width:125px;
float:left;
background: rbackground: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #f1f1f1 50%, #e1e1e1 51%, #f6f6f6 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(50%,#f1f1f1), color-stop(51%,#e1e1e1), color-stop(100%,#f6f6f6)); /* Chrome,Safari4+
*/
background: -webkit-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */
line-height:50px;
text-align:center;
border-right:1px solid #000;
font-family: 'Francois One', sans-serif;
}
.child{
border-bottom-left-radius:50px;
border-top-left-radius:50px;
}
.child1{
border-bottom-right-radius:50px;
border-top-right-radius:50px;
}
.menu li:hover{
background:background: #ffffff; /* Old browsers */
background: -moz-radial-gradient(center, ellipse cover, #ffffff 0%, #e5e5e5 100%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#ffffff), color-stop(100%,#e5e5e5)); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, #ffffff 0%,#e5e5e5 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, #ffffff 0%,#e5e5e5 100%); /* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, #ffffff 0%,#e5e5e5 100%); /* IE10+ */
background: radial-gradient(ellipse at center, #ffffff 0%,#e5e5e5 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
color:#FDD017
}
h1{
font-family:'Francois One', sans-serif;
font-size:72px;
display:block;
text-align: center;
color: white;
text-shadow: 0 0 20px #fefcc9, 10px -10px 30px #feec85, -20px -20px 40px #ffae34, 20px -40px 50px #ec760c, -20px -60px 60px #cd4606, 0 -80px 70px #973716, 10px -90px 80px #451b0e;
}
A.class1 {color:black;}
A.class1:link {text-decoration: none; color: black;}
A.class1:visited {text-decoration: none; color: none;}
A.class1:hover {text-decoration: underline; color: orange;}
A.class1:active {text-decoration: none; color: orange;}
<!DOCTYPE html>
<html>
<head><meta charset="UTF-8" />
<title>Home</title>
<link href='http://fonts.googleapis.com/css? family=Francois+One' rel='stylesheet' type='text/css'>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
</style>
</head>
<body>
<div id="container">
<ul class="menu">
<li class="child"><a href="index.html" class="class1">HOME</a></li>
<li><a href="about_me/about_me.html" class="class1">ABOUT ME</a></li>
<li><a href="inspiration/inspiration.html" class="class1">INSPIRATION</a></li>
<li class="child1"><a href="contact_me/contact_me.html" class="class1">CONTACT ME</a></li>
</ul>
</div>
<h1>Welcome to Justin Sanchez's Lair!</h1>
</body>
</html>
*{
margin:0px;
padding:0px;
}
body{
background:url(../images/background.jpg);
height:100%;
width:100%;
}
#container{
margin-top:10px;
margin-left:710px;
}
.menu{
list-style:none;
}
.menu li{
display:block;
height:50px;
width:125px;
float:left;
background: rbackground: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #f1f1f1 50%, #e1e1e1 51%, #f6f6f6 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(50%,#f1f1f1), color-stop(51%,#e1e1e1), color-stop(100%,#f6f6f6)); /* Chrome,Safari4+
*/
background: -webkit-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */
line-height:50px;
text-align:center;
border-right:1px solid #000;
font-family: 'Francois One', sans-serif;
}
.child{
border-bottom-left-radius:50px;
border-top-left-radius:50px;
}
.child1{
border-bottom-right-radius:50px;
border-top-right-radius:50px;
}
.menu li:hover{
background:background: #ffffff; /* Old browsers */
background: -moz-radial-gradient(center, ellipse cover, #ffffff 0%, #e5e5e5 100%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#ffffff), color-stop(100%,#e5e5e5)); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, #ffffff 0%,#e5e5e5 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, #ffffff 0%,#e5e5e5 100%); /* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, #ffffff 0%,#e5e5e5 100%); /* IE10+ */
background: radial-gradient(ellipse at center, #ffffff 0%,#e5e5e5 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
color:#FDD017
}
h1{
font-family:'Francois One', sans-serif;
font-size:72px;
display:block;
text-align: center;
color: white;
text-shadow: 0 0 20px #fefcc9, 10px -10px 30px #feec85, -20px -20px 40px #ffae34, 20px -40px 50px #ec760c, -20px -60px 60px #cd4606, 0 -80px 70px #973716, 10px -90px 80px #451b0e;
}
A.class1 {color:black;}
A.class1:link {text-decoration: none; color: black;}
A.class1:visited {text-decoration: none; color: none;}
A.class1:hover {text-decoration: underline; color: orange;}
A.class1:active {text-decoration: none; color: orange;}
*{
margin:0px;
padding:0px;
}
body{
background:url(../images/background.jpg);
height:100%;
width:100%;
}
#container {
float:left;
width:100%;
overflow:hidden;
position:relative;
}
#container ul {
clear:left;
float:left;
list-style:none;
margin:0;
padding:0;
position:relative;
left:50%;
text-align:center;
}
#container ul li {
display:block;
float:left;
list-style:none;
margin:0;
padding:0;
position:relative;
right:50%;
}
#container ul li a {
display:block;
margin:0 0 0 1px;
padding:3px 10px;
text-decoration:none;
line-height:1.3em;
}
.menu{
list-style:none;
}
.menu li{
display:block;
height:50px;
width:125px;
float:left;
background: rbackground: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #f1f1f1 50%, #e1e1e1 51%, #f6f6f6 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(50%,#f1f1f1), color-stop(51%,#e1e1e1), color-stop(100%,#f6f6f6)); /* Chrome,Safari4+
*/
background: -webkit-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */
line-height:50px;
text-align:center;
border-right:1px solid #000;
font-family: 'Francois One', sans-serif;
}
.child{
border-bottom-left-radius:50px;
border-top-left-radius:50px;
}
.child1{
border-bottom-right-radius:50px;
border-top-right-radius:50px;
}
.menu li:hover{
background:background: #ffffff; /* Old browsers */
background: -moz-radial-gradient(center, ellipse cover, #ffffff 0%, #e5e5e5 100%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#ffffff), color-stop(100%,#e5e5e5)); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, #ffffff 0%,#e5e5e5 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, #ffffff 0%,#e5e5e5 100%); /* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, #ffffff 0%,#e5e5e5 100%); /* IE10+ */
background: radial-gradient(ellipse at center, #ffffff 0%,#e5e5e5 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
color:#FDD017
}
h1{
font-family:'Francois One', sans-serif;
font-size:72px;
display:block;
text-align: center;
color: white;
text-shadow: 0 0 20px #fefcc9, 10px -10px 30px #feec85, -20px -20px 40px #ffae34, 20px -40px 50px #ec760c, -20px -60px 60px #cd4606, 0 -80px 70px #973716, 10px -90px 80px #451b0e;
}
A.class1 {color:black;}
A.class1:link {text-decoration: none; color: black;}
A.class1:visited {text-decoration: none; color: none;}
A.class1:hover {text-decoration: underline; color: orange;}
A.class1:active {text-decoration: none; color: orange;}
<!DOCTYPE html>
<html>
<head><meta charset="UTF-8" />
<title>Home</title>
<link href='http://fonts.googleapis.com/css? family=Francois+One' rel='stylesheet' type='text/css'>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
</style>
</head>
<body>
<div id="container">
<ul class="menu">
<li class="child"><a href="index.html" class="class1">HOME</a></li>
<li><a href="about_me/about_me.html" class="class1">ABOUT ME</a></li>
<li><a href="inspiration/inspiration.html" class="class1">INSPIRATION</a></li>
<li class="child1"><a href="contact_me/contact_me.html" class="class1">CONTACT ME</a></li>
</ul>
</div>
<h1>Welcome to Justin Sanchez's Lair!</h1>
</body>
</html>
我相信这就是你想要的。
html:
<div id="container">
<span><!--place menu in a span to align it with h1 tag-->
<ul class="menu">
<li class="child"><a href="index.html" class="class1">HOME</a></li>
<li><a href="about_me/about_me.html" class="class1">ABOUT ME</a></li>
<li><a href="inspiration/inspiration.html" class="class1">INSPIRATION</a></li>
<li class="child1"><a href="contact_me/contact_me.html" class="class1">CONTACT ME</a></li>
</ul>
</span>
<div id="spacer"></div><!--used to provide spacing between menu-->
<span id="title"><!-- enclosed h1 tag to align it below ul list above-->
<h1>Welcome to Justin Sanchez's Lair!</h1>
</span>
</div>
.css:
/*used to place space between menu and h1 text*/
#spacer{
height:300px;
}
body{
background:url(../images/background.jpg);
height:100%;
width:100%;
}
#container{
margin-top:10px;
margin-left:710px;
}
.menu{
list-style:none;
}
.menu li{
display:block;
height:50px;
width:125px;
float:left;
background: rbackground: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #f1f1f1 50%, #e1e1e1 51%, #f6f6f6 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(50%,#f1f1f1), color-stop(51%,#e1e1e1), color-stop(100%,#f6f6f6)); /* Chrome,Safari4+
*/
background: -webkit-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */
line-height:50px;
text-align:center;
border-right:1px solid #000;
font-family: 'Francois One', sans-serif;
}
.child{
border-bottom-left-radius:50px;
border-top-left-radius:50px;
}
.child1{
border-bottom-right-radius:50px;
border-top-right-radius:50px;
}
.menu li:hover{
background:background: #ffffff; /* Old browsers */
background: -moz-radial-gradient(center, ellipse cover, #ffffff 0%, #e5e5e5 100%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#ffffff), color-stop(100%,#e5e5e5)); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, #ffffff 0%,#e5e5e5 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, #ffffff 0%,#e5e5e5 100%); /* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, #ffffff 0%,#e5e5e5 100%); /* IE10+ */
background: radial-gradient(ellipse at center, #ffffff 0%,#e5e5e5 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
color:#FDD017
}
h1{
font-family:'Francois One', sans-serif;
font-size:72px;
display:block;
text-align: center;
color: white;
text-shadow: 0 0 20px #fefcc9, 10px -10px 30px #feec85, -20px -20px 40px #ffae34, 20px -40px 50px #ec760c, -20px -60px 60px #cd4606, 0 -80px 70px #973716, 10px -90px 80px #451b0e;
}
A.class1 {color:black;}
A.class1:link {text-decoration: none; color: black;}
A.class1:visited {text-decoration: none; color: none;}
A.class1:hover {text-decoration: underline; color: orange;}
A.class1:active {text-decoration: none; color: orange;}
相关文章:
- xmlhttp.responseText不显示文本
- 如何在MVC中使用jQuery在文本框旁边显示文本
- 根据页面的位置突出显示文本中的字符
- 当选择值x时,Javascript需要在正确的位置显示文本区域,从而循环通过具有选择选项的表单
- 操作javascript变量[HTML]以只显示文本
- 如何显示文本长度,即使它超过ng最大长度
- 如何在悬停时显示文本而不移动页面上的内容
- ASP.NET MVC,在文本框旁边显示文本
- 可单击滚动图像以显示文本框
- 使用鼠标悬停JavaScript/HTML显示文本
- 延迟高亮显示文本区域中的文本
- 选择“选择选项”时显示文本.怎么做
- 无法使用JavaScript在画布上显示文本
- 在不更改HTML源代码的情况下,在管理员TinyMCE编辑器中突出显示文本
- 将鼠标悬停在图像上时显示文本
- javascript:在for循环中使用settimeout来定期显示文本
- 一页主题搜索/用下一个按钮突出显示文本
- JavaScript 在更改选择时不显示文本区域
- 用于突出显示文本的JQuery/JavaScript插件
- 模式显示文本区域内容不是字符串