div背景,除了标题,不会显示? [英] div backgrounds, except header, wont show up?

查看:100
本文介绍了div背景,除了标题,不会显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了大约一个星期,但我还没有找到一个真正帮助我的答案。
im相当基本的html和我真正拥有的最多体验是neopets lol



即时为我的班级在学校制作一个页面,并且我有三个div ID目前在我的页面中激活。 header div工作正常,但我的mainContent和导航id似乎忽略了我希望bg颜色为橙色的事实。

  HTML:
< html>< head>< title> GUMI MEGPOID |家庭及LT; /标题>< /头>
< body>
< div id =header>< h1> GUMI MEGPOID< / h1>< / div>
< div id =navigation>
< p>< a href ={text:Link one url}>主页< / a>
< a href ={text:链接两个网址}>专辑< / a>
< a href ={text:Link three url}>歌词< / a>
< a href ={text:Link four url}> Tours< / a>
< / p>< / div>
< div id =mainContent>< p>等等等等等等< p>< / div>
< / body>< / html>

CSS:

  h1 {color:#eeee99; font-size:3 em; text-align:center; } 
h2 {color:#eeee99;行高:130%; font-size:1.75 em; font-family:宋体; }
h3 {color:#eeee99;行高:130%; font-size:1.625 em; }
p {color:#eeee99;行高:130%; font-size:.9em;余量:10%;保证金:10%; }
p1 {color:#eeee99;行高:130%; font-size:.75em; }
body {background-color:#eeee99; }
#header {width:650px; height:100px; line-height:100px;背景:rgb(238,119,34);利润率下限:10%; text-align:center; align:right; }
#mainContent {width:780px;身高:500px;背景:rgb(238,119,34); / *后备* /背景:rgba(238,119,34,.6); text-align:center; }
#navigation {width:200px; height:100px; top:auto; margin-left:160px;位置:固定; margin-top:10px; -webkit-transition:全部0.6s缓和; -moz-transition:全部0.6s缓出; -o-transition:全部0.6s缓出; }

#navigation a {font-size:11px; line-height:20px;显示:inline-block; margin-top:5px;宽度:100px; text-align:center;颜色:#eeee99; background-color:{color:#ee7722}; -webkit-transition:全部0.5s缓和; -moz-transition:全部0.5s缓出; -o-transition:全部0.5s缓出;过渡:全部0.5秒缓出; }

#navigation a:hover {color:#eeee99; background-color:{color:#ee7722};不透明度:0.5; -webkit-transition:全部0.5s缓和; -moz-transition:全部0.5s缓出; -o-transition:全部0.5s缓出;过渡:全部0.5秒缓出; }< /风格>


解决方案

此行中的双引号

 < div id =mainContent>< p> blah blah blah。< p>< / div> 

应该是 ()而不是卷曲 em>()引号。


ive searched around for about a week, but i havent found an answer that really helps me. im fairly basic at html and the most experience i really have is neopets lol

im making a page for my class at school, and i have three div ids currently active in my page. the header div works fine, but my mainContent and navigation ids seem to ignore the fact that i want the bg colour to be orange. any help would be appreciated!

HTML: 
<html><head><title>GUMI MEGPOID | Home</title></head>
<body>
<div id="header"><h1>GUMI MEGPOID</h1></div>
<div id="navigation">
<p><a href="{text:Link one url}">Home</a>
<a href="{text:Link two url}">Albums</a>
<a href="{text:Link three url}">Lyrics</a>
<a href="{text:Link four url}">Tours</a>
</p></div>
<div id="mainContent"><p>blah blah blah.<p></div>
</body></html>

CSS:

h1 {color: #eeee99; font-size: 3 em; text-align: center; }
h2 {color: #eeee99; line-height: 130%; font-size: 1.75 em; font-family: 宋体; }
h3 {color: #eeee99; line-height: 130%; font-size: 1.625 em; }
p {color: #eeee99; line-height: 130%; font-size: .9em; margin-left: 10%; margin-right: 10%; }
p1 {color: #eeee99; line-height: 130%; font-size: .75em; }
body { background-color: #eeee99; }
#header { width: 650px; height: 100px; line-height: 100px; background: rgb(238, 119, 34);  margin-bottom: 10%; text-align: center; align: right; }
#mainContent { width: 780px; height: 500px; background: rgb(238, 119, 34);  /* Fallback */ background: rgba(238, 119, 34, .6); text-align: center; }
#navigation { width: 200px; height: 100px; top: auto; margin-left: 160px; position: fixed; margin-top: 10px; -webkit-transition: all 0.6s ease-in-out; -moz-transition: all 0.6s ease-in-out; -o-transition: all 0.6s ease-in-out; }

#navigation a { font-size: 11px; line-height: 20px; display: inline-block; margin-top: 5px; width: 100px; text-align: center; color: #eeee99; background-color: {color: #ee7722}; -webkit-transition: all 0.5s ease-in-out; -moz-transition: all 0.5s ease-in-out; -o-transition: all 0.5s ease-in-out; transition: all 0.5s ease-in-out; }

#navigation a:hover { color: #eeee99; background-color: {color: #ee7722}; opacity: 0.5; -webkit-transition: all 0.5s ease-in-out; -moz-transition: all 0.5s ease-in-out; -o-transition: all 0.5s ease-in-out; transition: all 0.5s ease-in-out; }</style>

解决方案

The double quotes in this line

<div id="mainContent"><p>blah blah blah.<p></div>

should be straight (") instead of curly (") quotes.

这篇关于div背景,除了标题,不会显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆