Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to do a dropdown menu without Javascript or Jquery

Tags:

jquery

css

We have a requirement not to use javascript for dropdown menus. This requirement is due to maitain SEO value.

Is there any way to achieve this with purely css and make it work on all browsers.

I tried with li mouseover and mouseout , but its not working in IE7. its working only in Firefox.

Can you please advice or give directions on good solution.

thanks

like image 200
kobe Avatar asked Nov 01 '10 15:11

kobe


People also ask

Can you make a dropdown in HTML?

Step 1: Add a <label> element to your HTML document. This will be the name of your dropdown menu. Step 2: Add a <select> element. This creates the dropdown menu itself.

How do I make a simple drop-down menu?

Use any element to open the dropdown menu, e.g. a <button>, <a> or <p> element. Use a container element (like <div>) to create the dropdown menu and add the dropdown links inside it. Wrap a <div> element around the button and the <div> to position the dropdown menu correctly with CSS.

How do I create a drop-down menu in HTML and CSS?

Example Explained HTML) Use any element to open the dropdown content, e.g. a <span>, or a <button> element. Use a container element (like <div>) to create the dropdown content and add whatever you want inside of it. Wrap a <div> element around the elements to position the dropdown content correctly with CSS.

How do you create a dropdown list in HTML?

The <select> tag is used to create a drop-down list in HTML, with the <option> tag. Used to give a name to the control which is sent to the server to be recognized and get the value. This can be used to present a scrolling list box. If set to "multiple" then allows a user to select multiple items from the menu.


2 Answers

Yes it is.

see: http://www.cssplay.co.uk/menus/dropdown.html

like image 154
Diodeus - James MacFarlane Avatar answered Oct 03 '22 21:10

Diodeus - James MacFarlane


You can do it just with CSS

#item {
    display: none;
}

#item:hover {
    display: block
}

Also have a look here:

http://lwis.net/free-css-drop-down-menu/

You might face an issue with IE6 for hover over HTML element different of so you can use this hack/fix

http://www.xs4all.nl/~peterned/csshover.html

I tested this: http://lwis.net/free-css-drop-down-menu/dropdown.simple.horizontal.html

works under IE 6/7/8, tested with IETester

like image 36
Alex Rashkov Avatar answered Oct 03 '22 23:10

Alex Rashkov