html - 非常基本的 HTML 页面不会显示

标签 html css

我不确定这里发生了什么,我制作了一个非常基本的 HTML/CSS 页面,它只是在我的浏览器中显示一个空白页面。

<HTML>
    <head> 
        <style type="text/css">
        #sidebar {float:left; width:20%;}
        .post {float:right; width:79%;}
        #footer {clear:both;}
    </head>
    <body>
        <div id="header">
            <h1>My interesting life</h1> 
        </div> 
        <div id="sidebar"> 
            <h2>Menu</h2>
            <ul>
                <li>Place Link Here</li> 
                <li>Place Link2 Here</li>  
            </ul>  
        </div>
        <div class="post">
            <h2>Yesterday</h2> 
            <p>Today I drank coffee for breakfast.  14 hours later, I went to bed. </p> 
        </div>  
        <div class="post">
            <h2>Yesterday</h2> 
            <p>Ran out of coffee, so had orange juice for breakfast.  It was from concentrate.</p> 
        </div>
        <div id="footer"> 
            <p><small> This is copyright by Monu.  Contact me to negotiate the movie rights. </small></p>  
        </div>
    </body>
</HTML>

最佳答案

您需要关闭您的 <style>标签:

<head> 
    <style type="text/css">
        #sidebar {float:left; width:20%;}
        .post {float:right; width:79%;}
        #footer {clear:both;}
    </style>
</head>

关于html - 非常基本的 HTML 页面不会显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8689906/

相关文章:

html - 修改 CSS 文件

javascript - QGraphicsWebView : create a text file using Javascript

html - Accordion h3 文本在 IE 中消失

Jquery UI 可排序,突出显示选定或拖动的框

HTML/CSS - 背景图片不工作

html - 当存在 iOS 7 虚拟键盘时,Div 元素不会停留在底部

html - 在 Ionic3 中使用 SCSS 为页面上所有元素的背景和文本着色

javascript - 将 string.indexOf 的结果转换为 DOM 元素的引用路径

css - 粘住并旋转时样式化元素

html - 菜单表无法正确呈现