This article mainly introduces jquery + css to implement the gorgeous horizontal level-2 drop-down menu-with source code download. if you need it, refer to the following:
View results Source Code Download
Html code:
The code is as follows:
%;Transform:Translate ( -50%,-50%);-webkit-transform:Translate ( -50%,-50%);Background-color:Gray;Color: White;position:Absolute; }class= "wp"> class= "Test "> content div>div> 4. Flexible boxYou do not need to specify a height width for the child block, and the child block is not visible when there is no content in the child block and the height is not set.IE6/7/8/9 not supported. WP{Display:-webkit-box;Display:-moz-box;Display:-ms-flexbox;Display:-webkit-flex;Display:Flex;-webkit-box-align:
In fact, this menu should be called level-2, but many friends are used to calling it level-3. Let it go! Correctly displayed in ie6.0 ie5.x firefox1.x ns7.2 opera8.0, with only a few JSCode, You only need to insert the
Code in the horizontal direction:
CSS code# Nav, # nav ul {float: Left; List-style: none; line-Height: 22px; Background: # f9f9f9; /* -- set the menu background color -- */font-weight: bo
[Css Interview Questions] The Three divs require horizontal alignment. The width of the left and right divs is fixed to PX, and the middle DIV is filled with the remaining width (at least two methods). div100px
This is a problem I encountered during an interview with a company. I didn't answer it !!
So you must pay attention to your friends !!
Change the browser width to see the effect:
Left and right
Th
In actual web development, most of the time it takes to process form. There are also many controls in this aspect in the ext framework, and there is also a special formpanel layout. By default, all the controls placed on the panel are placed with line breaks, in practical applications, horizontal layout is required for the sake of appearance, especially the radio controls. At this time, we need to re-customize the layout of these controls. In this exa
Idea: Sub-element absolute positioning, distance from top 50%, left 50%, then use CSS3 transform:translate (-50%;-50%)Pros: Tall, can be used in the WebKit kernel browserCons: Unsupported IE9 The following does not support transform propertiesDOCTYPE HTML>HTMLLang= "en">Head> MetaCharSet= "UTF-8"> title>Unknown wide-height element horizontally vertically centeredtitle>Head>style>. Parent3{position:relative;Height:300px;width:300px;background:#FD0C70;}. Parent3. Child{position:Absolute;Top:
There are a number of layout solutions that are vertically centered horizontally, and this article only lists three.The display effect in the browser:The first: Using Flex to lay out is the most common way:. Container { width: 400px; height: 300px; background: Blue; display: flex; justify-content: Center; align-items: center;} . Center { width: 200px; height: 100px ; Background: green;}The second type: absolute positioning plus CSS3 2D conversion mode.. Containe
Pure CSS to judge the ipad horizontal and vertical version, some novice friends may not, want to learn when will not be late, then introduce implementation code, interested friends can study the nextThe code is as follows:
Method One:Container determination width: Knowledge Point: Transform can only be set on the element with display as block.Method One:Method Two: 利用 flex 布局 实际使用时应考虑兼容性,flex不兼容ie9父容器高度没有设置,那么其高度就是子容器撑开的,也就没有垂直居中这一说,只需要水平居中即可。. Container{Display:Flex;Align-items:Center;/*Center Vertically*/justify-content:Center;/*Center Horizontally*/}. Container Div{width:100px;Height:100px;Background-color:Pink;/*easy to see effect*/} CSS
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.