The example in this article describes how to use the drop-down menus in the YII2 framework to automatically search for Yii-widget-select2. Share to everyone for your reference, as follows:
GitHub Source code Address: Https://github.com/kartik-v/yii2-widget-select2
Install this plugin with Composer.phar:
PHP Composer.phar require kartik-v/yii2-widget-select2 "*"
Reference method:
Use Kartik\select2\sel
You need to wrap the drop-down menu trigger and drop- .dropdown down menu in, or another position: relative; declared element.
Pop up: First line replaced .dropup by class
Right Justification: for .dropdown-menu adding .dropdown-menu-right
分割线:role="separator" class="divider">
禁用:class="disabled">href="#">Disabled link
标题:class="dropdown-header">Dropdown header
Bootstrap about
With the concept of Web page standardization popular, more and more websites adopt CSS architecture. CSS Architecture Web pages are not only consistent with the standards of the consortium, but also very attractive. Standardized web pages start with a nice CSS menu, and if you're still hesitating, take a look at the following
Implement provincial/municipal drop-down cascade menus in json format [original]-orange time
This article is original to the blogger. For more information, see.
First, let's take a look at the implementation:
Of course, to complete this experiment, mysql must be connected to the database. here we use navicat for mysql, which is highly compatible with mysql. the configuration environment is not described i
Implementation of the Meituan and Volkswagen drop-down menus;
Recently, the drop-down menu similar to Meituan and Volkswagen was used in the project. So I went online to find the information and got a demo. The two listview functions were not very good. I found the ExpandTab custom control and encapsulated the two listview, it is indeed a lot easier to use,
I have collected a few good drop-down menu effects. The current drop-down menu is more and more compatible, and no js is the best. However, if you can achieve the effect with the least code, it is also good.
First, the js used is very short and clear.
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
This is also good.
[Ctrl + A select all Note: If yo
Drop down Menu
Display:block, the box will become expanded to populate the parent element by shrinking the bounding element
Position:absolute is the absolute position relative to the parent element, and its coordinates are relative to the parent element, such as the Align Drop-down menu
CSS code copy content to clipboard
. mene Li Ul{
Display:block;
Positio
Horizontal drop-down menu
[Ctrl + A full selection Note: If you need to introduce external JS need to refresh to execute]
CSS drop-down navigation menu effect
[Ctrl + A full selection Note: If you need to introduce external JS need to refresh to execute]
CSS Horizontal
After learning the last tutorial, I think it is much easier to study this section.
Horizontal menu is through div and javasprict to achieve Drop-down control, vertical menu? The answer is yes. What we're going to do now is a vertical menu, CSS code:
UL {margin:0; padding:0; list-style:none; width:120px; border-bottom:1px solid #ccc; font-size:12px;}
UL li {position:relative;}
Li ul {position:absolute; left
There are various very beautiful CSS menus on the network, but most of them are static, and menu items are all written to the page, which is not very flexible, every time you want to modify the menu, you must modify the page. The following describes an example of a dynamic CSS menu that reads menu items from the database.
1. First, create the menu of the data tab
How to Use CSS to write a drop-down menu ., Css write drop-down menu
Navigation menus are essential functions for every website and must be accessed by friends who learn how to create a website. How can I create a simple and beautiful level-2
define the UL id= "NAV" on it. We do not recommend that you do this, to know that our site is extensible, we want to leave enough room for future expansion, if our navigation style design more complex, the only UL can not meet the needs. We define such containers to be more consistent with our code-writing habits.#nav定义了窗口的宽高及背景颜色. #nav ul contains margin and padding declarations, font and color declarations. line-height:30px is a very important definition, and if you cancel the definition of l
page code is changed:
Homepage
Product Introduction
Service Introduction
Technical support
Buy Now
Contact us
CSS is defined:
. Test ul {list-style: none ;}
Note: ". test ul" indicates that the style I want to define will apply to ul labels in the test layer.
Now the effect is no dot:
Homepage
Product Introduction
Service Introduction
Technical support
Buy Now
Contact us
Step 3: Key fluctuations
Here is the key to cha
The CSS tree menus written for the first time in the previous two CSS tree menus are relatively simple. There are only two levels of directories, and there are less than ten lines of javascript code, mainly implemented by the inclusion Writing Method in CSS.
Demo address:
(
{ Background:url (%e9%a1%b9%e7%9b%ae%e7%ac%a6%e5%8f%b7.png) no-repeat 0 50%;//This time must write background height: 30px;line-height:30px; padding-left:30px; Display:block; width:70px; Background-color: #CCC; border:1px solid #666; }At this point, you will find that the middle border line is thicker, you can solve the problem by removing the bottom border, and then adding the last item or the first item:li{ border-bottom:0; } UL #last {
assignment' FALLBACK_CB ' = ' wp_page_menu ',//Alternate navigation menu function to invoke when navigation is not set in the background' Before ' = ',//Show before navigation a label' After ' = ',//Show after navigation a label' Link_before ' = ',//appears after the navigation link name' Link_after ' = ',//appears before the navigation link name' Items_wrap ' = ' ////Display the number of menu layers, the default 0,0 is to show all layers' Walker ' = '////Call an object definition to display t
Examples of foldable level-2 menus implemented by JavaScript + CSS, javascriptcss
The examples in this article describe the foldable level-2 menu implemented by JavaScript + CSS. We will share this with you for your reference. The details are as follows:
. Aspx file:
Js file:
function doMenu(obj){ var items=obj.parentNode.getElementsByTagName("ul"); var itmUl; i
The simplest way to create a CSS-style text navigation bar might be to put all the links in one line of text, which looks reasonable and intuitive. But the problem is that it's hard to control the gaps between links and back and forth by putting all the links in one line of text. So, in order to avoid all the links being squeezed together, you end up having to insert something or a non-newline blank character as a separator to separate the text from t
To create a bevel menu is to use the corner of the border to construct a bevel, each menu item of a element, a SPAN element, set to the corner class, to achieve the bevel effect.Set the A element to relative positioning, a is a child of span set to absolute positioning, and then set the top and left of span to zero, so that the bevel is positioned in the upper-right corner bounded by the border.The following code shows the effect as followsDOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional/
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.