我有两个无序列表,但第二个正试图成为第一个的子列表并缩进。看起来像这样:
我试图像“寻求冒险”一样将“博客文章”移到左侧,然后将第二个无序列表作为该“标题”的子项目符号
当我第一次尝试进行故障排除时,我意识到我没有关闭链接,博客文章成为了链接的一部分,但是当我关闭链接时,它看起来仍然很奇怪。
此代码都在这样的函数中:
function badgerPass(){
html = "";
title ='<h3>Badger Pass - Yosemite</h3>';
//seek adventure
seekAdventureTitle = '<p>Seek Adventure</p>';
seekAdventure = '<ul><li><a href="https://www.seekadventure.net/d/79-22-hours-of-driving-1-5-days-of-snowshoeing-yosemite-nationa">22 Hours of Driving, 1.5 Days of Snowshoeing, Yosemite National Park!</a></li></ul';
//blogs
blogTitle = '<p>Blog Posts</p>';
blogs = '<ul><li><a href="https://socalhiker.net/snowshoeing-to-dewey-point-in-yosemite/">Snowshoeing to Dewey Point in Yosemite</a></li></ul';
html = title + seekAdventureTitle + seekAdventure + blogTitle + blogs;
return html;
};
答案 0 :(得分:1)
您错误地关闭了UL。
seekAdventure = '<ul><li><a href="https://www.seekadventure.net/d/79-22-hours-of-driving-1-5-days-of-snowshoeing-yosemite-nationa">22 Hours of Driving, 1.5 Days of Snowshoeing, Yosemite National Park!</a></li></ul';
应该是:
seekAdventure = '<ul><li><a href="https://www.seekadventure.net/d/79-22-hours-of-driving-1-5-days-of-snowshoeing-yosemite-nationa">22 Hours of Driving, 1.5 Days of Snowshoeing, Yosemite National Park!</a></li></ul>';