JQuery Mobile Tutorial: Grid component Design Implementation Details

Source: Internet
Author: User

Article Introduction: in this article, we have a deep understanding of the design implementation details of the grid component in jquery mobile through source analysis.

In this article, we have a deep understanding of the design implementation details of the grid component in jquery Mobile through the source analysis method.

First look at the jquery.mobile-1.1.0.css style design Source:
/*grid class*/. ui-grid-a,.ui-grid-b,.ui-grid-c,ui-grid-d{ 	Overflow:hidden;  /*block of class*/. ui-block-a,.ui-block-b,.ui-block-c,.ui-block-d,.ui-block-e{ 	margin:0; 	padding:0; 	border:0; 	Float:left;		adopt float 	min-height:1px;}   /*2 ui-grid-a. Ui-block-a, ui-grid-a ui-block-b{ 	width:50%;		2 columns in ui-grid-a. ui-block-a{ 	Clear:left} 	 /*3, Ui-grid-b ui-block-a, Ui-grid-b ui-block-b, Ui-grid-b ui-block-c{ 	;	3 columns in Ui-grid-b. ui-block-a{ 	Clear:left}  /*4, Ui-grid-c ui-block-a, Ui-grid-c ui-block-b, ui-grid-c. Ui-block-c ui-grid-c,. ui-block-d{ 	%;	    4 columns in ui-grid-c. ui-block-a{ 	Clear:left} 	 /*5, ui-grid-d ui-block-a, ui-grid-d ui-block-b, ui-grid-d. Ui-block-c,. ui-grid-d.,. ui-block-e{ 	width:20%;		5 columns in ui-grid-d. ui-block-a{ 	clear:left	 }    
What if we want to implement a custom irregular grid?

For example: I want to set 2 columns, left 30%, right 70%

. ui-grid-a. ui-block-a{ 	width:30%; ui-grid-a. ui-block-b{ 	

Another example: I want to set 3 columns, left 30%, Middle 20%, right 50%

. ui-grid-b. ui-block-a{ 	width:30%; ui-grid-b. ui-block-b{width:20% 	; ui-grid-b 	


Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.