由于某种原因,我结束了div标签,但文本没有显示在框下方: http://codepen.io/refath1/pen/NPbKaB
</div>
So,we know everything
答案 0 :(得分:4)
它就在那里,但你忘了关闭一个<font>
标签,所以它只是白色:
<font color=white>
内的 <div>
从未关闭。嵌套HTML是一个好习惯,这样你就可以看到发生了什么:
<div>
<font color=white>
A car is traveling at <i>x</i> mph.The car has traveled
<font color=yellow>
<u>57 miles</u>
</font>
over a time span of
<font color=lightblue>
<u>9 Hours</u>
</font>.
What was the car's
<b>
<font color=lightgreen>
Average Speed?
</font>
</b>
</font> <-------THIS WAS MISSING
</div>
So,we know everything
答案 1 :(得分:2)
文字白底白字,所以你看不到它。
编辑:只是,为了记录,这是我见过的最糟糕的HTML!非常&#39; 90s。我建议您查看一些基本的HTML教程 - 可能是https://www.khanacademy.org/或者只是Google HTML和CSS教程
答案 2 :(得分:0)
你有一个未封闭的标签。
<font color=lightgreen>
没有相应的关闭标记。
顺便说一下,您不应该使用<font>
标记,因为它们已被弃用。最好使用CSS进行格式化。
答案 3 :(得分:0)
完整代码,当您打开任何标记时,必须以</>
您的代码中的错误<font color=lightgreen>
没有像</font>
试试这个
<style>
div {
background-color: #FF9494;
width: 300px;
padding: 25px;
border: 2px solid;
box-shadow: 10px 10px 5px #888888;
box-shadow-color:lightgreen;
border-radius: 25px;
border: 25px solid lightpink;
margin: 25px;
}
</style>
</head>
<body>
<h1><font color=lightgreen>An Introduction to </font><font color=lightblue>Physics</font></h1>
<h2><font color=#FF9494><u>Speed</u></font></h2>To find the speed of a given object,we must know the distance it has traveled as well as the<i> t</i> time it took for the object to travel <i>d</i> distance.Lets apply what we know to this problem:
<div><font color=white>A car is traveling at <i>x</i> mph.The car has traveled <font color=yellow><u>57 miles</u></font> over a time span of <font color=lightblue><u>9 Hours</u></font>.What was the car's <b><font color=lightgreen>Average Speed</font></b> ? </font></div>
So,we know everything
</body>