Horizontal drop down menu using css

Sandeep Reddy K.

I am trying to create a horizontal drop down menu with 3 levels of sub menus. I have almost created all menu items. I am trying to make it more understandable to user. I want to put small arrow mark if the any li has sub menu. Is it possible to do using css? I am unable to get any solution. Please suggest me what to do?

Here is my example code:

     <ul id="menu_new">
    <li><a href="#" class="HeaderLink">Home</a></li>
    <li><a href="#" class="HeaderLink">Applications</a>
        <ul>                                      
            <li><a href="#">Agency</a>
                <ul>
                    <li><a href="/apps/banner/web_links/NVE_South_Agency_PRDv2.ica" >NVE South</a></li>
                    <li><a href="#">NVE North</a></li>
                </ul>
            </li>
            <li><a href="#">Manual Crawl</a></li>
            <li><a href="#">Crawl Interval</a></li>
            <li><a href="#">Archive List</a></li>
        </ul>
    </li>
    <li><a href="#"> Visual Analytics</a></li>
    <li><a href="#">Settings</a>
        <ul>                                      
            <li><a href="#">Manage Subject</a>
                <ul>
                    <li><a href="#" >Add Subject</a></li>
                    <li><a href="#">Edit Subject</a></li>
                    <li><a href="#">Delete Subject</a></li>
                    <li><a href="#">Export Subject</a></li>
                </ul>
            </li>
            <li><a href="#">Manual Crawl</a></li>
            <li><a href="#">Crawl Interval</a></li>
            <li><a href="#">Archive List</a></li>
        </ul>
    </li>
</ul>

Demo

Gildas.Tambo

Try something like this:

#menu_new >li:nth-child(2){
    position:relative;
    padding-right:20px;
}
#menu_new >li:nth-child(2):before{
    position:absolute;
    content:'';
    top:14px;
    right:0;
    width:0;
    height:0;
    border-left:10px solid transparent;
    border-right:10px solid transparent;
    border-top:10px solid white;
}

DEMO

and if you want to use it on more that one place you can create a class ie: .arrow with the same css above.

[class^=arrow]{
    position:relative;
    padding-right:20px;
}
[class^=arrow]:before{
    position:absolute;
    content:'';
    width:0;
    height:0;
}

.arrow-down:before{
    right:0;
    top:14px;
    border-left:10px solid transparent;
    border-right:10px solid transparent;
    border-top:10px solid white;
}
.arrow-right:before{
    right:4px;
    top:4px;
    border-top:6px solid transparent;
    border-bottom:6px solid transparent;
    border-left:6px solid white;
}

DEMO

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

CSS drop down menu not appearing

分類Dev

Position of drop down menu using only CSS and HTML

分類Dev

Drop-Down menu using CSS :target pseudo

分類Dev

How to drop down menu wordpress only css

分類Dev

CSS drop down menu weird behavior

分類Dev

issue with multi-level css drop down menu

分類Dev

Fix drop-down menu CSS style without star hack

分類Dev

CSS drop down menu :hover state doesnt seem to work

分類Dev

Drop-down Menu on Hover

分類Dev

Drop down menu doesnt work

分類Dev

Drop Down CSS is not working

分類Dev

Drop down menu moving down page content

分類Dev

Using webdriver with c# how can I select a drop down item by text if the drop down menu is not a select element?

分類Dev

How do I stop links from wrapping onto multiple lines in a CSS drop down menu?

分類Dev

How to show Icon in drop down menu of PopupMenu

分類Dev

Fix width of drop down menu in select option

分類Dev

Drop Down - Submenu menu Disappear while hover

分類Dev

drop down menu not working and in wrong position

分類Dev

filtering select drop down menu to filter in React?

分類Dev

How To Make A Decent Drop Down Menu?

分類Dev

Drop down menu for selecting country then states then district

分類Dev

PHP drop down menu list categories

分類Dev

Swing - Android like Drop-Down-Menu

分類Dev

Creating a conditional drop-down menu in Excel

分類Dev

Drop down menu on click on variable id

分類Dev

Rails: creating a drop down menu for a form

分類Dev

Not full width css horizontal menu

分類Dev

How to add options tabbed menu to mega drop-down menu?

分類Dev

How to change the position of a drop down arrow in CSS

Related 関連記事

ホットタグ

アーカイブ