Austin Wiggins Austin Wiggins - 29 days ago 5
HTML Question

Separated elements overlooked, now combined

Currently in the process of learning MVC and I think it's interfering with HTML code. I have just a basic navigational menu as a list and two

<li>
items seem to combine into one. Any way to make sure the two are separated when live?

@if ((Request.Url.AbsolutePath.ToString().ToLower() != "/home/index") && (Request.Url.AbsolutePath.ToString() != "/"))
{
<nav data-spy="affix" data-offset-top="500" style="border-radius:0px; left: 0" ng-hide="sideBar" id="nav">
<img src="~/Content/images/open.png" ng-model="sideBar" id="sideBarOpen" style="left:0px; top:0;"/>
<div id="sideBar" style="left: -200px">
<ul>
<li><a href="@Url.Action("Index", "Home")" id="navHeader"> Home </a></li>
<li><br /></li>
<li><a href="@Url.Action("AboutMe", "Home")" id="">About Me</a></li>
#############
<li><a href="@Url.Action("Experience", "Home")" id=">Experience</a></li>
<li><a href="@Url.Action("Resume", "Home")" id="">Resume</a></li>

############ These two seem to be recognized as 1 <li> and not two.

<li><a href="@Url.Action("Contact", "Home")" id="">Contact</a></li>
</ul>
<img src="/Content/images/myPic.jpg" />
</div>
</nav>
<div id="sideBarBack" style="width:0%;">
</div>
}

Answer

Youre missing a quotation mark in the id="> part. This is not a valid html so your wen browser tries to workaround that resulting in the two elements combined.

To fix that instead of:

<li><a href="@Url.Action("Experience", "Home")" id=">Experience</a></li>

use a correct tag attribute id="":

<li><a href="@Url.Action("Experience", "Home")" id="">Experience</a></li>
Comments