树莓派Apache2服务器HTML页面显示>截断文本问题求助
页面文本截断显示
>的排查与解决 初始问题
我是HTML新手,几乎一窍不通。想在树莓派4上搭建一个仿Apple iCloud风格的Apache2服务器,找了合适字体后做了个原型,但页面出了问题:
- Chromium浏览器里,页面文本被截断,末尾显示
>,完整的“另存为”说明显示不全,底部两行内容每个页面都有,特别显眼。 - 按
CTRL+SHIFT+I打开Chrome开发者工具,发现HTML代码里也有>,怀疑是UTF-8编码的问题。
使用的样式表master.stylesheet.css代码:
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap'); body { font-family: 'Share Tech Mono', monospace; } p.breadcrumb { font-size: 25px; text-decoration: none; color: black; margin-left: auto; margin-right: auto; } p.breadcrumb a { text-decoration: none; color: black; } p.breadcrumb a:hover { text-decoration: underline; }
注:我今年10岁,麻烦用简单的话解答。
问题解决
后来发现是自己HTML写错了——把<br/>写成了</br>,修复后问题就解决了。修复后的HTML代码如下:
<!DOCTYPE html> <html> <head> <title>Lloyd Family Cloud Server</title> <link type="text/css" rel="stylesheet" href="css/master.stylesheet.css"> </head> <body> <p class="breadcrumb"> <a href="">Home</a> / </p> <p class="intro">Hey Family! This is a server set up by <strong>Ted</strong> to share files around the house.<br/> Please email me at <a href="mailto:mrtedlloyd@gmail.com">mrtedlloyd@gmail.com</a></p> <p class="intro">Choose a directory to get going. Please note this cloud server only works on our WiFi.</p> <nav> <ul> <li><a href="Music/">Music [Music, DIRECTORY]</a></li> </ul> </nav> <p class="instructions"> For phones or tablets, please hold your finger on the link to download it.<br/>For desktops, please click on the link, and then hit CTRL + S, and follow the 'save as' instructions.</p> </body> </html>
现在问题已经解决啦,谢谢大家!
内容的提问来源于stack exchange,提问作者user21327672
相关产品推荐
相关产品推荐

