Technical Discussion
  >> Web Design / HTML / Web hosting Forum


Register (or login) on our website and you will not see this ad.


Pages in this thread: 1 | 2 | (show all)   Print Thread
Standard User cheshire_man
(knowledge is power) Mon 28-Nov-11 13:53:14
Print Post

Drop down menu problem


[link to this post]
 
I need to be able to do a drop down menu where there are 2 or 3 groups of items on the drop down. I don't want to use second level menus, irrelevant why.

Essentially what I'm trying to do is:

Item 1
Item 2
Group 1
Item 3
Item 4
Group 2
Item 5

Only the Item x lines will be clickable links.

I can do the drop down menu but can't get the 'group' lines in. I'm sure I've seen this around but cannot find where now.

Any helpful suggestions?

Tony
Standard User camieabz
(sensei) Mon 28-Nov-11 14:15:13
Print Post

Re: Drop down menu problem


[re: cheshire_man] [link to this post]
 
Fairly sure this will work:

<html>
<head>
</head>
<body>
	<ul>
		<li><a href="http://www.thinkbroadband.com">Item 1</a></li>
		<li><a href="http://www.thinkbroadband.com">Item 2</a></li>
		<li><a href="http://www.thinkbroadband.com">Group 1</a>

			<ul>
				<li><a href="http://www.thinkbroadband.com">Item 3</a></li>
				<li><a href="http://www.thinkbroadband.com">Item 4</a></li>
			</ul>

		</li>

		<li><a href="http://www.thinkbroadband.com">Group 2</a>

			<ul>
				<li><a href="http://www.thinkbroadband.com">Item 5</a></li>
			</ul>
		</li>
	</ul>

</body>
</html>



Edit: Those group headers are also clickable. Just make the link "#".

~~~~~~~~~~


© Camieabz 2002-2011

All Connection Data ~ plusnet

Scottish Labour politician: “The SNP are on a very dangerous tack. What they are doing is trying to build up a situation in Scotland where the services are manifestly better than south of the border in a number of areas.”

Interviewer: ”Is that a bad thing?”

Scottish Labour politician: “No, but they are doing it deliberately.”

Edited by camieabz (Mon 28-Nov-11 14:22:29)

Standard User SamsonUK
(knowledge is power) Mon 28-Nov-11 16:03:00
Print Post

Re: Drop down menu problem


[re: cheshire_man] [link to this post]
 
You need to use <optgroup>

eg

HTML
1
23
45
67
89
1011
1213
14
<select>
  <optgroup label="">    <option value="1">item1</option>
    <option value="2">item2</option>  </optgroup>
  <optgroup label="Group1">    <option value="3">item3</option>
    <option value="4">item4</option>  </optgroup>
  <optgroup label="Group2">    <option value="5">item5</option>
    <option value="6">item6</option>  </optgroup>
</select>


Register (or login) on our website and you will not see this ad.

Standard User camieabz
(sensei) Mon 28-Nov-11 16:21:28
Print Post

Re: Drop down menu problem


[re: SamsonUK] [link to this post]
 
Ahh, that kind of dropdown menu. Fair do's.

~~~~~~~~~~


© Camieabz 2002-2011

All Connection Data ~ plusnet

Scottish Labour politician: “The SNP are on a very dangerous tack. What they are doing is trying to build up a situation in Scotland where the services are manifestly better than south of the border in a number of areas.”

Interviewer: ”Is that a bad thing?”

Scottish Labour politician: “No, but they are doing it deliberately.”
Standard User cheshire_man
(knowledge is power) Mon 28-Nov-11 16:38:01
Print Post

Re: Drop down menu problem


[re: SamsonUK] [link to this post]
 
Apologies, I should have been clearer, I'm talking about drop down menus for navigation purposes, for example here.

Tony
Standard User micksharpe
(eat-sleep-adslguide) Mon 28-Nov-11 16:46:40
Print Post

Re: Drop down menu problem


[re: cheshire_man] [link to this post]
 
There are plenty of tutorials for creating drop-down menus using only HTML and CSS - for example. Google will provide links to many more.

__________________________________________________________________________________________
'There are moments, Jeeves, when one asks oneself, "Do trousers matter?"'
‘The mood will pass, sir.’
P.G. Wodehouse -- The Code of the Woosters
.
It Ought to be Easy | Greasemonkey scripts
Standard User camieabz
(sensei) Mon 28-Nov-11 19:57:33
Print Post

Re: Drop down menu problem


[re: cheshire_man] [link to this post]
 
My example will do the trick. If you want one with styling already in place, check out Stu Nicholls CSSplay.

~~~~~~~~~~


© Camieabz 2002-2011

All Connection Data ~ plusnet

Scottish Labour politician: “The SNP are on a very dangerous tack. What they are doing is trying to build up a situation in Scotland where the services are manifestly better than south of the border in a number of areas.”

Interviewer: ”Is that a bad thing?”

Scottish Labour politician: “No, but they are doing it deliberately.”
Standard User SamsonUK
(knowledge is power) Mon 28-Nov-11 20:49:28
Print Post

Re: Drop down menu problem


[re: camieabz] [link to this post]
 
I wasn't sure tbh, so gave the other option in case, looks like you were on the right lines though smile
Standard User cheshire_man
(knowledge is power) Sun 11-Dec-11 12:47:20
Print Post

Re: Drop down menu problem


[re: micksharpe] [link to this post]
 
Thanks, that link's code works on Firefox, but not on IE8, not currently sure why, the drop downs don't drop.

Tony
Standard User camieabz
(sensei) Sun 11-Dec-11 13:00:58
Print Post

Re: Drop down menu problem


[re: cheshire_man] [link to this post]
 
Care to post your menu css?

Edit: The menu HTML too actually.

~~~~~~~~~~


© Camieabz 2002-2011

All Connection Data ~ plusnet

Scottish Labour politician: “The SNP are on a very dangerous tack. What they are doing is trying to build up a situation in Scotland where the services are manifestly better than south of the border in a number of areas.”

Interviewer: ”Is that a bad thing?”

Scottish Labour politician: “No, but they are doing it deliberately.”

Edited by camieabz (Sun 11-Dec-11 13:01:44)

Pages in this thread: 1 | 2 | (show all)   Print Thread

Jump to