[Thùng rác] Thanh nav đa cấp

  Bài viết hay nhất1
Cái này là đóng góp đầu tiên của em, mong mọi người thông cảm
Demo: future-generation.ace.st ( Em lấy forum em làm demo luôn, sr)
Cách làm:
Đưa cái này vào CSS:
Code:
#nav li.active > a {
    background-color: #359BED;
    color: #FFFFFF;
}
/* submenu */
#nav li:hover ul.subs {
    display: block;
}
#nav ul.subs > li {
    display: inline-block;
    float: none;
    padding: 10px 1%;
    vertical-align: top;
    width: 33%;
}
#nav ul.subs > li a {
    color: #777777;
    line-height: 20px;
}
#nav ul li a:hover {
    color: #F55856;
}
#nav ul.subs > li > a {
    font-size: 1.3em;
    margin-bottom: 10px;
    text-transform: uppercase;
}
#nav ul.subs > li li {
    float: none;
    padding-left: 8px;
    -moz-transition: padding 150ms ease-out 0s;
    -ms-transition: padding 150ms ease-out 0s;
    -o-transition: padding 150ms ease-out 0s;
    -webkit-transition: padding 150ms ease-out 0s;
    transition: padding 150ms ease-out 0s;
}
#nav ul.subs > li li:hover {
    padding-left: 15px;
}
/* common and top level styles */
#nav span {
    display: none;
}
#nav, #nav ul {
    list-style: none outside none;
    margin: 0;
    padding: 0;
}
#nav {
    background-color: #F5F5F5;
    border-bottom: 5px solid #359BED;
    float: left;

    position: relative;
    width: 100%;
}
#nav ul.subs {
    background-color: #FFFFFF;
    box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
    color: #333333;
    display: none;
    left: 0;
    padding: 2%;
    position: absolute;
    top: 54px;
    width: 96%;
}
#nav > li {
    border-bottom: 5px solid transparent;
    float: left;
    margin-bottom: -5px;
    text-align: left;
    -moz-transition: all 300ms ease-in-out 0s;
    -ms-transition: all 300ms ease-in-out 0s;
    -o-transition: all 300ms ease-in-out 0s;
    -webkit-transition: all 300ms ease-in-out 0s;
    transition: all 300ms ease-in-out 0s;
}
#nav li a {
    display: block;
    text-decoration: none;
    -moz-transition: color 450ms ease-in-out 0s, background-color 450ms ease-in-out 0s;
    -ms-transition: color 450ms ease-in-out 0s, background-color 450ms ease-in-out 0s;
    -o-transition: color 450ms ease-in-out 0s, background-color 450ms ease-in-out 0s;
    -webkit-transition: color 450ms ease-in-out 0s, background-color 450ms ease-in-out 0s;
    transition: color 450ms ease-in-out 0s, background-color 450ms ease-in-out 0s;
    white-space: normal;
}
#nav > li > a {
    color: #333333;
    display: block;
    font-size: 1.3em;
    line-height: 49px;
    padding: 0 15px;
    text-transform: uppercase;
}
#nav > li:hover > a, #nav > a:hover {
    background-color: #F55856;
    color: #FFFFFF;
}
Tiếp tục, đưa cái này vào overal header
Code:
 </script>
   
<body onload="_l='t';">

<ul id="nav">
                <li><a href="#">Home</a></li>
                <li><a href="#s1">Menu 1</a>
                    <span id="s1"></span>
                    <ul class="subs">
                        <li><a href="#">Header a</a>
                            <ul>
                                <li><a href="#">Submenu x</a></li>
                                <li><a href="#">Submenu y</a></li>
                                <li><a href="#">Submenu z</a></li>
                            </ul>
                        </li>
                        <li><a href="#">Header b</a>
                            <ul>
                                <li><a href="#">Submenu x</a></li>
                                <li><a href="#">Submenu y</a></li>
                                <li><a href="#">Submenu z</a></li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li class="active"><a href="#s2">Menu 2</a>
                    <span id="s2"></span>
                    <ul class="subs">
                        <li><a href="#">Header c</a>
                            <ul>
                                <li><a href="#">Submenu x</a></li>
                                <li><a href="#">Submenu y</a></li>
                                <li><a href="#">Submenu z</a></li>
                            </ul>
                        </li>
                        <li><a href="#">Header d</a>
                            <ul>
                                <li><a href="#">Submenu x</a></li>
                                <li><a href="#">Submenu y</a></li>
                                <li><a href="#">Submenu z</a></li>
                            </ul>
                        </li>
                    </ul>
                </li>
               
            </ul>

Vậy là xong, mọi người có thể tùy chỉnh lại code trong trong header, thay dấu # thành link, còn mấy cái Submenu đó sửa thành nội dung trên Nav, vậy thôi, em chỉ làm được có vậy, nếu bài này đã tồn tại hoặc có lỗi thì mong Ad del bài hộ em, em cảm ơn! :)
  Bài viết hay nhất2
xin lỗi chứ Script đâu ?! O.o
The author of this message was banned from the forum - See the message
  Bài viết hay nhất4
[Only admins are allowed to see this link]
conchimchienchien wrote:ờ cám ơn đóng góp của bạn , sau này đi copy nhớ ghi nguồn nữa nhé :3 [Only admins are allowed to see this link] :D cái này bữa mình cũng add vào rồi :3 (y) tìm vs từ khóa html5 css3 nav là sẽ thấy :)) . :D xin thân ái
link gốc k đưa đưa link topic bạn share skin làm gì , lại nhắc ng khác ghi nguồn .
@ chủ topic : bạn xem lại phần HTMl trong code bạn share nhé , bổ sung nguồn , xoá đi phần thừa , ng k biết add vào có thể gây ra lỗi .
The author of this message was banned from the forum - See the message
  Bài viết hay nhất6
You cannot reply to topics in this forum