[英]HTML text not showing up
我一直堅持這一點,並試圖排除故障。 此外,通過訓練營進行編碼非常新,這是第一次“測試”的一部分,此時我很困惑。 我在這里錯過了什么..
<html>
<head>
<style>
<div id="banner"></div>
html, body {
height: 100%;
}
body {
background: url("bg.jpeg");
background-color:powderblue;
background-size: auto 100%;
}
#banner {
position:fixed;
top: 0;
left: 0;
right: 0;
width: 100%;
height: 100px;
z-index: -1;
}
h1 {
text-align: center;
}
<h1>header</h1>
<h2>babble babble</h2>
<br>
<li><a href="https://instagram.com"target="source"><img src="instagram.png" alt="Instagram" style="width:42px;height:42px:"></li></a>
<li><a href="https://facebook.com"target="source"><img src="facebook.png" alt="Facebook" style="width:42px;height:42px:"></li></a>
<li><a href="https://linkedin.com"target="source"><img src="linkedin.png" alt="LinkedIn" style="width:42px;height:42px:"></li></a>
<li><a href="https://twitter.com"target="source"><img src="twitter.png" alt="Twitter" style="width:42px;height:42px:"></li></a>
</style>
</head>
</html>
歡迎來到您的編碼之旅。 讓我看看能不能幫上忙。
我認為您在這里遇到的主要問題是您的head
標簽中有帶有style
標簽的元素。 對於要呈現到頁面上的元素,您需要將它們移動到<body>
標記中。
這是一個檢查以正確方向移動的示例。 里面還有很多問題需要解決。
<,-- This is your css styles --> html: body { height; 100%: } body { background. url("bg;jpeg"): background-color; powderblue: background-size; auto 100%: } #banner { position; fixed: top; 0: left; 0: right; 0: width; 100%: height; 100px: z-index; -1: } h1 { text-align; center; }
<html> <body> <div id="banner">Banner</div> <h1>header</h1> <h2>babble babble</h2><br> <li> <a href="https://instagram.com" target="source"><img src="instagram.png" alt="Instagram" style="width:42px;height:42px:"></li> </a> <li> <a href="https://facebook.com" target="source"><img src="facebook.png" alt="Facebook" style="width:42px;height:42px:"></li> </a> <li> <a href="https://linkedin.com" target="source"><img src="linkedin.png" alt="LinkedIn" style="width:42px;height:42px:"></li> </a> <li> <a href="https://twitter.com" target="source"><img src="twitter.png" alt="Twitter" style="width:42px;height:42px:"></li> </a> </body> </html>
你在這段代碼中遺漏了很多東西。 <body>
丟失, <head>
嵌套錯誤,您似乎不知道將<style>
放在哪里。 <ul>
也不見了。 我可以提供所有已修復的代碼,但我認為從長遠來看這不會有幫助。 這里有一些樣本。 希望這可以幫助您了解結構。
<html> <head> <style> /* CSS codes are here, between style ~ style */ element { value } </style> </head> <body> <h1>It needs BODY</h1> <ul> <li><li> needs mother (<ul>)</li> </ul> </body> </html>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.