Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-29-2011, 08:22 AM   PM User | #1
nowave7
New to the CF scene

 
Join Date: Dec 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
nowave7 is an unknown quantity at this point
Positioning inner UL to outer UL

Hey all,

I'm having a problem building a menu using ul elements. The menu looks something like this:

Code:
    <ul class="level0">
	<li id="nav-1-1" class="level1"><span> Option1 </span>
	<ul id="submenu" class="">
		<li class="level2" first="" nav-2-2="">
		<li class="level2" first="" nav-2-2="">
		<li class="level2" first="" nav-2-2="">
	</ul>
	</li>
	<li id="nav-1-1" class="level1"><span> Option2 </span>
	<ul id="submenu" class="">
		<li class="level2" first="" nav-2-2="">
		<li class="level2" first="" nav-2-2="">
		<li class="level2" first="" nav-2-2="">
	</ul>
	</li>
</ul>
I would like to position all of the inner ul elements (two in this case) to a specific place relative to outer ul element (for example top right corner of the outer ul) and not the li that contains them. Is this possible at all, without using the position: fixed ?Any help is greatly appreciated!
nowave7 is offline   Reply With Quote
Old 12-29-2011, 10:01 AM   PM User | #2
html-tutorials
New Coder

 
Join Date: Dec 2011
Location: San Francisco, CA
Posts: 24
Thanks: 0
Thanked 5 Times in 5 Posts
html-tutorials is an unknown quantity at this point
You have an error in your source code.

Your LI tag inside the UL are not closed.

The solution to your problem:

try:

Code:
<li style = "position: absolute; top:0; left:0; width:200px; height: 20px;"></li>
(please close your LI tags!)

width and height are whatever you want them to be

Of course, you can make the CSS external, but you get the idea

Important:

In order for this to work, make sure the UL container has "relative" positioning:

Code:
<ul style = "position:relative">
good luck
__________________
Hi, I'm Greg. I am a web designer.
I like to share my knowledge with others.
Web design costs calcuator | jQuery plugin tutorial
Make cinnamon french toast | bora
html-tutorials is offline   Reply With Quote
Old 12-29-2011, 12:31 PM   PM User | #3
nowave7
New to the CF scene

 
Join Date: Dec 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
nowave7 is an unknown quantity at this point
Yes, the code I posted is just an example, more of a pseudo-code, the real code is a bit more complex and quite long to put in here. Sorry 'bout that.
nowave7 is offline   Reply With Quote
Old 12-29-2011, 01:51 PM   PM User | #4
nowave7
New to the CF scene

 
Join Date: Dec 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
nowave7 is an unknown quantity at this point
Anyway, this is the site that you can see how it looks at the moment:
http://colijn.staging.levi9.com/meubelplaza/
If you'd select filter a drop-down menu will appear, and then you can hover over different options in that menu. Each option has a sub-menu that opens to the right, but at a different top position. What i would like is that all of these sub-menus open at the same position.
nowave7 is offline   Reply With Quote
Reply

Bookmarks

Tags
css, html, list, menu, position

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:01 AM.


Advertisement
Log in to turn off these ads.