为什么我不能在此HTML文档中添加更多段落?

为什么我不能在此HTML文档中添加更多段落?,第1张

概述我已经完成了Codecademy的 HTML和CSS课程,现在我想学习 Python. 在此之前,我想建立一个关于我即将学习的东西的小网站,只是为了练习我的HTML和CSS技能. 我遇到了麻烦,因为我无法在HTML文件下添加更多内容,也不知道原因. 这是HTML(也在http://pastebin.com/br4W1YGL): <!DOCTYPE HTML><html> <head> 我已经完成了Codecademy的 HTML和CSS课程,现在我想学习 Python.

在此之前,我想建立一个关于我即将学习的东西的小网站,只是为了练习我的HTML和CSS技能.

我遇到了麻烦,因为我无法在HTML文件下添加更多内容,也不知道原因.

这是HTML(也在http://pastebin.com/br4W1YGL):

<!DOCTYPE HTML><HTML>    <head>        <Meta http-equiv="Content-Type" content="text/HTML; charset=utf-8">        <link rel="stylesheet" type="text/CSS" href="style.CSS">        <Title>Python</Title>    </head>    <body>        <div >            <h2>Welcome to the Flying Circus</h2>            <p>Python is a powerful,flexible programming language you can use in web/Internet development,to write             desktop graphical user interfaces (GUIs),create games,and much more. Python is:</p>            <ul>            <li><strong>High-level</strong>,meaning reading and writing Python is really easy—it looks a lot like regular English!</li>            <li><strong>Interpreted</strong>,meaning you don't need a compiler to write and run Python! You can write it here at Codecademy             or even on your own computer (many are shipped with the Python interpreter built in—we'll get to the interpreter later in this lesson).</li>            <li><strong>Object-orIEnted</strong>,meaning it allows users to manipulate data structures called <strong>objects</strong> in order to build and execute programs.             We'll learn more about objects later.</li>            <li><strong>Fun to use</strong>. Python is named after Monty Python's Flying Circus,and example code and tutorials             often refer to the show and include jokes in order to make learning the language more interesting.</li>            </ul>            <p>This course assumes no prevIoUs kNowledge of Python in particular or programming/computer scIEnce in general.</p>            <div ID="instrucoes">            <h4>INSTRUCTIONS</h4>            <p>Ready to learn Python? Click Save & submit Code to continue!</p>            </div>            <div ID="hint">            <h4>Hint</h4>            <p>If the loading bar fills but doesn't fade away,try refreshing the page.</p>            </div>        </div>        <a ID="voltar" href="#">[ voltar ]</a>        <div >            print "Welcome to Python!"        </div>        <p>oi<p>    </body></HTML>

CSS(http://pastebin.com/48XvxedE):

HTML,body,form,fIEldset,legend {    margin: 0;    padding: 0;}h1,h2,h3,h4,h5,h6,p {    margin-top: 0;}fIEldset,img {    border: 0;}legend{    color: #000;}sup {    vertical-align: text-top;}sub {    vertical-align: text-bottom;}table {    border-collapse: collapse;    border-spacing: 0;}caption,th,td {    text-align: left;    vertical-align: top;    Font-weight: normal;}input,textarea,select {    Font-size: 110%;    line-height: 1.1;}abbr,acronym {    border-bottom: .1em dotted;    cursor: help;}/*o meu código começa aqui,o código acima é um reset*//*Fonte do reset: http://www.maxdesign.com.au/articles/css-reset/ */HTML {    wIDth: 1300px;    margin: 0 auto;    Font-family: sans-serif;    Font-size: 0.95em;    color: #424242;    background-color: #FFFFFF;}body {}.texto {    position: absolute;    top: 20px;    wIDth: 550px;}#instrucoes {    background-color: #FAFAFA;    wIDth: 536px;    padding: 5px;    color: #585858;    border: 2px solID #D8D8D8;}#hint {    background-color: #FAFAFA;    wIDth: 536px;    padding: 5px;    color: #585858;    border: 2px solID #D8D8D8;    margin: 10px 0 0 0;}.codigo {    position: absolute;    left: 630px;    top: 65px;    padding: 10px;    wIDth: 676px;    height: 420px;    background-color: #e6efc2;    color: #264409;    border: 2px solID #c6d880;    Font-family: mono;    Font-weight: bold;    Font-size: 0.85em;}#voltar {    position: absolute;    left: 1275px;    top: 25px;    color: #585858;}a:link {text-decoration: none;}a:visited {text-decoration: none;}a:hover {background-color: #F2F2F2; }a:active {text-decoration: none;}hr {    border: 0;    wIDth: 100%;    color: #D8D8D8;    background-color: #D8D8D8;    height: 2px;}

这是我的Jsfiddle:http://jsfiddle.net/MBMf2/

这里有人知道为什么我不能添加更多段落吗?

解决方法 You can.

< p>元素必须位于main,第一个div中,类似texto,否则,就像你的“oi”文本一样,*它会出现在文档流程之外,因为你从@L_403_6@开始使用CSS.

此外,当您在上下文中使用时,这对您的包装器来说不是一个很好的做法:

.texto {    position: absolute;}

这可能会给你带来很多困惑,并且当从Codeacademy的网站(它是左侧边栏)脱离上下文时没有目的.

*您忘了关闭< / p> “oi”的元素,但不要担心它也会遇到最有经验的开发人员!事实上,it shouldn’t matter to the layout and browser rendering,但我认为,如果所有非自动关闭的元素都被关闭,那么它就会更加强大且面向未来.

总结

以上是内存溢出为你收集整理的为什么我不能在此HTML文档中添加更多段落?全部内容,希望文章能够帮你解决为什么我不能在此HTML文档中添加更多段落?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1074134.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存