The following menu works really fine in the browser, but I cant get it to validate as XHTML. I took this example out of my CSS Book. It says it is right, but seemingly it is not.
<ul id="leftNavi">
<li>
left menu1
</li>
<li class="SCNL">left menu2</li>
<ul id="subnavi">
<li>
menu2/1
</li>
<li>
menu2/2
</li>
<li>
menu2/3
<li>
</ul>
<li>
left menu3
</li>
</ul>
Here a link to the page: http://www.yiip.de/arbeit/testlayout/standard_template.html I am talking about the left menu.
<ul id="leftNavi">
<li >left menu1</li>
<li class="SCNL">left menu2
<ul id="subnavi">
<li>menu2/1</li>
<li>menu2/2</li>
<li>menu2/3</li>
</ul>
</li>
<li>left menu3</li>
</ul>
You had a couple of problems:
The line with 3 as the list item didn't have a correct closing <li> element; and
The subnav1 list wasn't contained within a <li> element. It can't be a direct child of another list, which was the main problem with validating your HTML.
Related
I am attempting to make my unordered list look like this:
I am getting this (note the duplicate bullet point):
My code reads as follows:
<ul class="main-link">
<li>
articles/
</li>
<li>
<ul>
<li class="sub-link">
beliefs respect and facts
</li>
</ul>
</li>
</ul>
I would like the extra solid bullet point to be deleted some how. Can anyone point me in the right direction?
You need to remove only one li tag, something like this:
<ul class="main-link">
<li>
articles/
<ul>
<li class="sub-link">
beliefs respect and facts
</li>
</ul>
</li>
</ul>
You can add the second "ul" inside the same "li". Means it is also a part of first "li" content.
<ul class="main-link">
<li>
articles/
<ul>
<li class="sub-link">
beliefs respect and facts
</li>
<li class="sub-link">
beliefs respect and facts
</li>
</ul>
</li>
</ul>
I want to create a menu with sub-menus. After moving to the top menu, display sub menu the whole width of the page. It works, but I've problems with mobile menu. I am using bootstrap, but I can't click on links. Code select link is below div. I have to that menu. Have you any ideas, what's wrong ?
<ul>
<li>Head link</li>
<div id="submenu"><li></li></div>
<li>Head link</li>
</ul>
First and foremost, having such a reputation, I shouldn't answer these kind of questions. I am sorry for that. But in the sense of helping the OP genuinely, I am answering this question. Please do read the How to ask a question in StackOverflow.
A lot of mistakes in your code:
You cannot have <div> directly inside <ul>.
You cannot have <li> directly inside <div>.
The submenu should be a class and not an id.
All the contents of <li> should be wrapped inside <a> tag.
If you are using the Bootstrap's navigation, you need to use data-toggle attributes.
Corrected Code:
<ul>
<li>
Head link
<div id="submenu">
<ul>
<li></li>
</ul>
</div>
</li>
<li>
Head link
</li>
</ul>
With data-toggle Attributes:
<ul>
<li class="dropdown">
Head link
<div id="submenu" class="dropdown-menu">
<ul>
<li></li>
</ul>
</div>
</li>
<li>
Head link
</li>
</ul>
I want two boxes with different content in them. I want them to line up at top. Default they line up with bottom http://jsfiddle.net/52VtD/9772/
How do I get them at top instead of bottom?
<ul class="list-inline">
<li class="box">
<ul>
<li>
aaa
</li>
<li>
aaa
</li>
</ul>
</li>
<li class="box">
<ul>
<li>
aaa
</li>
<li>
aaa
</li>
<li>
aaa
</li>
</ul>
</li>
</ul>
You need to vertically align the initial list items. Add the CSS (or rather, combine with the current rule):
.box{
vertical-align:top;
}
Demo Fiddle
Note that your HTML is also invalid, you need to ensure you are correctly closing each li
I have a dropdown menu on my site - http://lady-cosmetics.ru/
The problem is that if I click on any link from dropped menu nothing happens. It behaves just like if I click not on the link, but on empty space, the menu only disappears.
Try to roll over the last item of the menu and you'll see what I mean.
The problem exists only on IOS 7.x in any browser.
Here is html of the menu:
<ul>
....
<li class="has-sub">
Все бренды
<ul class="subMenu">
<li>
<a target="_self" href="/collection/emerald-bay">Emerald Bay</a>
</li>
<li>
<a target="_self" href="/collection/gehwol">Gehwol</a>
</li>
</ul>
</li>
.....
</ul>
As you can see it is just a simple list that converts to dropdown menu by jquery plugin.
Why links from dropped part of the menu don't work in IOS?
It works fine on my iphone/ipad you can still try doing this thing
<ul>
....
<li class="has-sub">
Все бренды
<ul class="subMenu">
<li>
Emerald Bay
</li>
<li>
Gehwol
</li>
</ul>
</li>
.....
</ul>
I am trying to make a bootstrap single level menu using angularJS.
It already works with js and html when the <li> is dynamically built.
Now I am trying to use AngularJS.
Suppose I have a JS object which has Cust and then orders inside.
How can I make a list menu
<ul>
<li ng-repeat="cust in customers">
<p>{{cust.name}}</p>
<li ng-repeat="order in cust.orders">
<p>{{order.desc}}</p>
</li>
</li>
<ul>
This doesn't load properly (overlapping items) as the first li can't be closed.
Christopher is right, you can't do without <ul>.
I think you can do this to have a one level menu :
<ul>
<li ng-repeat="cust in customers">
<p>{{cust.name}}</p>
<div ng-repeat="order in cust.orders">
<p>{{order.desc}}</p>
</div>
</li>
<ul>
And perhaps play with CSS to style in the way you want.
Or this, too :
<ul>
<li ng-repeat="cust in customers">
<p>{{cust.name}}</p>
<p ng-repeat="order in cust.orders">
{{order.desc}}
</p>
</li>
<ul>
That's invalid markup, you're missing a ul
Try
<ul>
<li ng-repeat="cust in customers">
<p>{{cust.name}}</p>
<ul>
<li ng-repeat="order in cust.orders">
<p>{{order.desc}}</p>
</li>
</ul>
</li>
</ul>
That should render it correctly, your bindings are correct.