I have a navigation menu and I want the dropdown links to be in two separate columns.
I've tried using the columns property of CSS and have played around with other recommendations I have found online.
The html:
<nav id="nav">
<ul>
<li>Home</li>
<li>
Services
<ul>
<li><img src="images/icon_service1.png" alt="Service1" />Service 1</li>
<li><img src="images/icon_service2.png" alt="Service2" />Service 2</li>
</ul>
</li>
<li>
About
<ul>
<li><img src="images/icon_about1.png" alt="About1" />About 1</li>
</ul>
</li>
</ul>
The CSS:
I tried to post the CSS but kept getting an error that it wasn't indented properly with 4 spaces...? I'll try to post it in the comments...
The JS:
Dropdowns.
$('#nav > ul').dropotron({
offsetY: -16,
mode: 'fade',
noOpenerFade: true,
hideDelay: 400
});
The menu is displaying as a single dropdown and I want to show it as two columns.
I would preferably like to have it show two columns if there are 8 or more items in the drop down preferably, but I could set the css separately if need be.
I have tried css Columns but nothing I've tried has worked.
I'm attaching the CSS as images because the editor won't seem to let me add CSS...
enter image description here
enter image description here
Related
I have 3 menus with subitems in my navbar, those subitems are linked to specific sections id of the main page as such:
<ul id="navbar">
<li id="idli1" class="listli">
navbar-Item1
</li>
<li id="idli2" class="listli">
navbar-Item2
<ul class="sublist">
<li id="idsubli1" class="sublistli">
sub-Item 1</li>
<li id="idsubli2" class="sublistli">
sub-Item 2</li>
<li id="idsubli3" class="sublistli">
sub-Item 3</li>
</ul>
</li>
<li id="idli3" class="listli">
navbar-Item3
</li>
</ul>
On desktop everything works fine.
On mobile the link seems to not be valid, the formula https://www.site.co/page/#id doesn't work.
Clicking on the submenu just close the submenu.
If i remove the section id from the link, the subitem works and goes to the page.
you can check the menu here
am i missing something about mobile and anchors?
i really don't understand what is the problem about those links.
on mobile your navbar collapse from what I have seen so maybe its being assigned an id that you have used in your menu already thus the link won't work - ids should be unique
The link for Drop down 1 and 2 does not want to work.
The page with this code is http://www.lansdownesdachurch.co.za/index.html
I have left the drop down menu visible while trying to sort out this problem.
<nav>
<ul class="nav">
<li><a class="current" href="index.html">Home</a></li>
<li>About Us
<ul>
<li>Drop down 1</li>
<li>Drop down 2</li>
</ul>
</li>
<li>Our Beliefs</li>
<li>Bible Study</li>
</ul>
</nav>
In your href of drop down, put the name of your html page instead of #
For example, if drop down 1 must redirect to books and drop down 2 to sea:
<li>Drop down 1</li>
<li>Drop down 2</li>
Your href attributes are empty, you need to point them to html file you want to open, I'd go with relative URL in your case to keep it simple. You can read more details on drop-down menus here.
I am trying to solve the reason that the unit test on testdome.com failing >my HTML code.
The output seems to be all right.
The URL of the task: https://www.testdome.com/Questions/HtmlCss/Inspector/6932?testId=13&testDifficulty=Easy
I am getting message: Lists and images: Wrong.
<ol>
<li><em>Company's logo</em></li>
<li>List of employees</li>
</ol>
<ul>
<li>New logo:</li>
<img src="new_logo.gif" />
<li>Old logo:</li>
<img src="old_logo.gif" />
</ul>
Omit the end slash from the img tag and add an alt tag. Also, enclose the img tag within the li tags (so you have 2 list items instead of 4 - the names with the images underneath is how it's currently coded). Then you should be ok.
Sample :
<ol>
<li><em>Company's logo</em></li>
<li>List of employees</li>
</ol>
<ul>
<li>New logo:<img src="new_logo.gif" alt="new logo"></li>
<li>Old logo:<img src="old_logo.gif" alt="old logo"></li>
</ul>
I am editing horizontal navigation bar and need to add description text before the links. My problem that all the text displays after links in the browser. How can I modify css or code to change the location of the text in nav bar? 'DIRECTORIES:' and 'SEARCH:' That I need to display in the browser just before the links, not after
<div id="navcontainer">
<ul id="navlist">
<li id="active">Home</li>
<li>SEARCH: Product Technologies</li>
<li>Trials & Registries</li>
<li> DIRECTORIES: PIs</li>
<li>PI Study Sites</li>
<li>Products
<li>Companies/Sponsors</li>
<li>MIB Custom Alerts</li>
</ul>
Maybe I'm misunderstanding the question, but isn't it as easy as going from this:
<li>SEARCH: Product Technologies</li>
to
<li>label goes hereSEARCH: Product Technologies</li>
Edit: In regards to your comment, why not: <li>Search</li>?
I am working on a drop down menu. Trouble that I am facing is that, I have a 3 level of <ul>, and in second level when height of a <li> increases because it was accommodating another <ul> then all other <li> of second level do not wrap around it.
You can visualize the situation in this Fiddle
when you hover your mouse over Technology then you would be able to see that size of Web Design <li> is greater because of another <ul> that it is accommodating, because of that Typography and Front end has dropped below. Is there any way to keep them wrapping around?
Html structure is like this:
<nav id="nav" role="navigation">
<ul class="clearfix">
<li> <span>Technology</span>
<ul>
<li>Hot news</li>
<li>Sad news</li>
<li>Normal news</li>
<li>Web Design
<ul>
<li>Super power
</li>
<li>Aim Gain
</li>
<li>Acheivers
</li>
<li>Lackers</li>
</ul>
</li>
<li>Typography
</li>
<li>Front-End
</li>
</ul>
</li>
<li>Personal Stuff
</li>
</ul>
EDIT: Attaching few screenshots
This image shows present problem, see position of Typography and Front-end
Following image shows what I am trying to achieve, see position of Typography and Front-end
Here you go: JSFiddle
UPD: JSFiddle in acc to screenshot (Need to update CSS rules)
UPD: JSFiddle example based on classes
I've just removed the margin-left:20px; on #nav li ul li > ul
Tested on Safari 6.1 (Mac OS X 10.9) |
UPD: additionally tested on Chrome (30) & FF (23.0.1) under Mac OS X 10.9