簡體   English   中英

HTML 文本未顯示

[英]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>&lt;li&gt; needs mother (&lt;ul&gt;)</li> </ul> </body> </html>

Html 內文<div>沒有出現</div><div id="text_translate"><p>如果鼠標指針懸停在它上面,我試圖創建一張在 3D 中旋轉的卡片。 我已經成功添加了卡片正面的背景和圖像,但是<strong>當嘗試向其添加文本時(即嘗試向 div 元素添加文本時),它不顯示。</strong></p><p> 錯誤的 html 代碼:</p><pre> &lt;div class="front"&gt; &lt;div class="front_card_icon"&gt; &lt;img src="image/indoor_plants_icon_white.svg"&gt; &lt;/div&gt; &lt;p&gt;THIS TEXT IS THE PROBLEM&lt;/p&gt; &lt;/div&gt;</pre><p> 錯誤的 css 代碼:</p><pre> .front { width: 100%; height: 100%; overflow: hidden; backface-visibility: hidden; position: absolute; transition: transform.6s linear; background-color: #2D3436; }.front_card_icon{ position: relative; bottom: 8%; transform: scale(0.70); z-index: 2; }.front p { positon:relative; text-align: center; color:white; }</pre><p> 根據 <a href="https://stackoverflow.com/questions/35021149/text-in-the-div-not-showing" rel="nofollow">這篇</a>帖子,使用position:relative后問題應該已經解決了</p><p>標簽,但遺憾的是這並沒有解決我的問題。</p><p> 這是我的問題的<a href="https://jsfiddle.net/King_Fish/s4h0u96j/" rel="nofollow">jsfiddle</a> 。 請注意,文本已正確顯示,因為無法加載圖像。 但是,加載圖像時,<strong>不會顯示文本,盡管圖像是透明的</strong>。</p><p> 感謝您的時間!</p></div>

[英]Html Text inside <div> is not showing up

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

相關問題 為什么這個 HTML 在瀏覽器中顯示為純文本? Html 內文<div>沒有出現</div><div id="text_translate"><p>如果鼠標指針懸停在它上面,我試圖創建一張在 3D 中旋轉的卡片。 我已經成功添加了卡片正面的背景和圖像,但是<strong>當嘗試向其添加文本時(即嘗試向 div 元素添加文本時),它不顯示。</strong></p><p> 錯誤的 html 代碼:</p><pre> &lt;div class="front"&gt; &lt;div class="front_card_icon"&gt; &lt;img src="image/indoor_plants_icon_white.svg"&gt; &lt;/div&gt; &lt;p&gt;THIS TEXT IS THE PROBLEM&lt;/p&gt; &lt;/div&gt;</pre><p> 錯誤的 css 代碼:</p><pre> .front { width: 100%; height: 100%; overflow: hidden; backface-visibility: hidden; position: absolute; transition: transform.6s linear; background-color: #2D3436; }.front_card_icon{ position: relative; bottom: 8%; transform: scale(0.70); z-index: 2; }.front p { positon:relative; text-align: center; color:white; }</pre><p> 根據 <a href="https://stackoverflow.com/questions/35021149/text-in-the-div-not-showing" rel="nofollow">這篇</a>帖子,使用position:relative后問題應該已經解決了</p><p>標簽,但遺憾的是這並沒有解決我的問題。</p><p> 這是我的問題的<a href="https://jsfiddle.net/King_Fish/s4h0u96j/" rel="nofollow">jsfiddle</a> 。 請注意,文本已正確顯示,因為無法加載圖像。 但是,加載圖像時,<strong>不會顯示文本,盡管圖像是透明的</strong>。</p><p> 感謝您的時間!</p></div> 網站在 PC 上顯示為部分文本和部分 html Django forms、html 標簽在前端顯示為文本 jQuery UI datepicker未顯示在html輸入文本上 為什么 HTML 鏈接沒有出現在我的文本中 單擊“返回”最終不會顯示文本(HTML、JS、CSS) HTML 內容未顯示 html圖像未顯示 HTML 按鈕未顯示
 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM