xSaoLx
Predictive Analytics Specialist
Divine
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
200 XP
In the previous tutorial, we create Mega Menu using the script. In this article, we are going to learn on How To Create Multilevel Dropdown Menu Using HTML/CSS without script. This source code is very simple and easy, and it's a pure CSS and HTML only.
Multilevel Menu - HTML
This HTML source code is used for displaying menu in multilevel.
Multilevel Menu - CSS
And, this is our style.
Share us your thoughts and comments below. Thank you so much for dropping by and reading this tutorial post. For more updates, don’t hesitate and feel free to visit this website more often and please share this with your friends or email me at [email protected]. Practice Coding. Thank you very much.
Download
Multilevel Menu - HTML
This HTML source code is used for displaying menu in multilevel.
- <ul
id
=
"menu"
>
- <li
class
=
"first_Menu"
><a
href
=
"#"
>
Menu 1</
a
>
- <ul
class
=
"sub_Menu"
>
- <li
class
=
"first_Menu"
><a
href
=
"#"
>
Example 1 <span
class
=
"expand"
>
»
</
span
></
a
>
- <ul
class
=
"sub_Menu"
>
- <li
><a
href
=
"#"
>
Example 1.1</
a
></
li
>
- <li
><a
href
=
"#"
>
Example 1.2</
a
></
li
>
- <li
><a
href
=
"#"
>
Example 1.3</
a
></
li
>
- </
ul
>
- </
li
>
- <li
><a
href
=
"#"
>
Example 2</
a
></
li
>
- <li
><a
href
=
"#"
>
Example 3</
a
></
li
>
- <li
><a
href
=
"#"
>
Example 4</
a
></
li
>
- </
ul
>
- </
li
>
- <li
class
=
"first_Menu"
><a
href
=
"#"
>
Menu 2</
a
>
- <ul
class
=
"sub_Menu"
>
- <li
><a
href
=
"#"
>
Example 1</
a
></
li
>
- <li
><a
href
=
"#"
>
Example 2</
a
></
li
>
- <li
class
=
"first_Menu"
><a
href
=
"#"
>
Example 3<span
class
=
"expand"
>
»
</
span
></
a
>
- <ul
class
=
"sub_Menu"
>
- <li
><a
href
=
"#"
nowrap>
Example 3.1</
a
></
li
>
- <li
><a
href
=
"#"
nowrap>
Example 3.2</
a
></
li
>
- </
ul
>
- </
li
>
- <li
><a
href
=
"#"
>
Example 4</
a
></
li
>
- </
ul
>
- </
li
>
- <li
class
=
"first_Menu"
><a
href
=
"#"
>
Menu 3</
a
>
- <ul
class
=
"sub_Menu"
>
- <li
><a
href
=
"#"
>
Example 1</
a
></
li
>
- <li
class
=
"first_Menu"
><a
href
=
"#"
>
Example 2 <span
class
=
"expand"
>
»
</
span
></
a
>
- <ul
class
=
"sub_Menu"
>
- <li
><a
href
=
"#"
>
Example 2.1</
a
></
li
>
- <li
><a
href
=
"#"
>
Example 2.2</
a
></
li
>
- <li
><a
href
=
"#"
>
Example 2.3</
a
></
li
>
- </
ul
>
- </
li
>
- <li
><a
href
=
"#"
>
Example 3</
a
>
- </
li
>
- <li
><a
href
=
"#"
>
Example 4</
a
></
li
>
- </
ul
>
- </
li
>
- </
ul
>
Multilevel Menu - CSS
And, this is our style.
- <style type=
"text/css"
>
- #menu
{
- width
:
400px
;
- margin
:
auto
;
- }
- .first_Menu
{
- display
:
block
;
- position
:
relative
;
- float
:
left
;
- line-height
:
30px
;
- background-color
:
blue
;
- border-right
:
blue
1px
solid
;
- }
- .first_Menu
a {
- margin
:
10px
;
- color
:
#FFFFFF
;
- font-size
:
20px
;
- text-decoration
:
none
;
- }
- .first_Menu
:
hover
>
ul {
- display
:
block
;
- position
:
absolute
;
- }
- .sub_Menu
{
- display
:
none
;
- }
- .sub_Menu
li {
- background-color
:
azure
;
- line-height
:
30px
;
- border-bottom
:
#CCC
1px
solid
;
- border-right
:
#CCC
1px
solid
;
- width
:
100%
;
- }
- .sub_Menu
li a {
- color
:
#000000
;
- }
- ul {
- list-style
:
none
;
- margin
:
0
;
- padding
:
0px
;
- min-width
:
10em
;
- }
- ul ul ul {
- left
:
100%
;
- top
:
0
;
- margin-left
:
1px
;
- }
- li:
hover
{
- background-color
:
red
;
- }
- .first_Menu
li:
hover
{
- background-color
:
#d0d0d0
;
- }
- .expand
{
- font-size
:
12px
;
- float
:
right
;
- margin-right
:
5px
;
- }
- </style>
Share us your thoughts and comments below. Thank you so much for dropping by and reading this tutorial post. For more updates, don’t hesitate and feel free to visit this website more often and please share this with your friends or email me at [email protected]. Practice Coding. Thank you very much.
Download
You must upgrade your account or reply in the thread to view the hidden content.