Html代码不起作用 [英] Html code not working

查看:85
本文介绍了Html代码不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它只显示背景图片没有ul命令



我尝试过:



 <   title  >  SupZone-最佳在线家具店



#mainpage {身高:100%;宽度:100%;保证金:无;}
#mainbody {height:100%; width:90%; margin:auto}
#header {height:60px; width:90%; border:2px solid black; font-size:50px }
#ul {background-color:brown; width:80%; height:40px; margin:auto; text-decoration:none; }











< span class =code-keyword>< div id = mainpage >
< / div >
< div id = mainbody >
< / div >
< div id = header < span class =code-keyword>>
< ul >
< li > < a href = > 主页< / a > < / li >
< <温泉n class =code-keyword>> < a href = > 关于我们< / a > < / li >
< li > < a href = > 与我们联系< / a > < / li >
< / ul >
< / div >

解决方案

< blockquote>您的样式不包含在样式标记中;页面没有正文;你也错过了结束标签...



您需要执行以下操作:

 <  !DOCTYPE     html  >  

< html lang = zh xmlns = http://www.w3.org/1999/xhtml >
< head >
< meta charset = utf-8 / >
< title > SupZone-最佳在线家具店< / title >
< style >
主页 { height 100%; width 100%; m argin 0; }
mainbody { height 100% ; width 90%; margin auto}
#header {height 60px; width 90%; border 2px solid black; font-size 50px}
#ul {background-color brown; width 80%; height 40px; margin auto; text-decoration none; }
< / 风格 >
< / head >
< 正文 >
< div < span class =code-attribute> id = header >
< ul >
< li > < a href = > 主页< / a > < / li >
< li > < a href = > 关于我们< / a > < / li >
< li > < < span class =code-leadattribute> a href = > 与我们联系< / a > < / li >
< / ul >
< div id = 主页 >
< p > 主页在此处< / p >
< div id = mainbody >
< p > 主体在这里< / p >
< / div >
< / div >
< / body >
< / html > a



您的代码需要大量工作。您可能更容易使用现有框架。这是一个包含模板的框架,可以帮助您快速入门: Bootstrap·世界上最受欢迎的移动优先和响应式前端框架。 [ ^ ]


嗯......那里有问题。

首先关闭你的标题标签 - 这样他们可能会处理它。


第一个问题是你的代码不是一个html文件。



你应该学习一个html文件的结构。

W3Schools在线网络教程 [ ^ ]

it just displays the background image no ul command

What I have tried:

<title>SupZone-The Best Online Furniture Store



#mainpage {height:100%;width:100%;margin:none;}
#mainbody {height:100%;width:90%;margin:auto}
#header {height:60px;width:90%;border:2px solid black;font-size:50px }
#ul {background-color:brown;width:80%;height:40px;margin:auto;text-decoration:none; }









 

<div id="mainpage">
</div>
<div id="mainbody">
</div>
<div id="header">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact us</a></li>
</ul>
</div>

解决方案

Your styles are not wrapped in a style tag; the page has no body; you're also missing closing tags...

You need to do the following:

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>SupZone-The Best Online Furniture Store</title>
    <style>
        #mainpage {height:100%;width:100%;margin:0;}
        #mainbody {height:100%;width:90%;margin:auto}
        #header {height:60px;width:90%;border:2px solid black;font-size:50px }
        #ul {background-color:brown;width:80%;height:40px;margin:auto;text-decoration:none; }
    </style>
</head>
<body>
    <div id="header">
        <ul>
            <li><a href="#">Home</a></li>
            <li><a href="#">About Us</a></li>
            <li><a href="#">Contact us</a></li>
        </ul>
    <div id="mainpage">
        <p>main page goes here</p>
    <div id="mainbody">
        <p>main body goes here</p>
    </div>
    </div>
</body>
</html>a


Your code needs a lot of work. It might be easier for you to work with an existing framework. Here is a framework with templates to get you started quickly: Bootstrap · The world's most popular mobile-first and responsive front-end framework.[^]


Well... there are problems there.
Start by closing your title tag - that way they rest of it might get processed.


The first problem is that your code is not an html file.

You should learn the structure of an html file.
W3Schools Online Web Tutorials[^]


这篇关于Html代码不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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