In fact WebApp This section has been placed for some time, but has not written articles, it is because I am still learning. Today, we will write an article about the layout, before no bootstrap,jquery easyui,jquery mobile, whether to do Web projects or Web Mobile site is so laborious, especially I do not learn CSS, it is not able to get the front desk. OK, nonsense not much to say, we look at today to copy the page, mobile phone headline web.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/57/1B/wKioL1SRkYnBfzswAAk72X4qGuY482.jpg "title=" Screenshot_2014-12-15-15-01-55.png "width=" "height=" 482 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:270px; height:482px; "alt=" wkiol1srkynbfzswaak72x4qguy482.jpg "/>
See, this interface can be simpler if used with bootstrap, because it is a simple three-column or two-column layout, using the bootstrap grid system can be well laid out. Today's words are still using jquery Mobile CSS.
@section header{ <div data-role= "Header" data-theme= "F" Data-tap-toggle= "false" data-position= "fixed" data-fullscreen= "false" > <div class= "Ui-grid-b" > <div class= "Ui-block-a" ></div> In fact, here we use some of the styles and properties of the jquery Mobile CSS. Let's take a look at data-role= "header."
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/57/1B/wKioL1SRk4uhyT_xAAGtACgkUsM176.jpg "title=" Qq20141217222732.jpg "alt=" Wkiol1srk4uhyt_xaagtacgkusm176.jpg "/>
Here we set the head not to data-tap-toggle= "false" when the screen is clicked, so that when the page content moves up with the scroll bar, it is covered by the head. Data-theme= "F" This is my own definition of the subject, the subject can be A-Z. jquery Mobile css, by default, provides only five themes.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/57/1B/wKioL1SRlNahMLirAACipLbUpqk766.jpg "title=" Qq20141217223335.jpg "alt=" Wkiol1srlnahmliraaciplbupqk766.jpg "/>
So F needs to define itself, let's take a look
. ui-bar-f {background-color:red; Color:white; Font-weight:bold; height:45px; Font-family: Microsoft Jas Black;}. Img-corner {border-radius:50%;}. A-header {text-decoration:none; Color:white;} Body {font-family: Microsoft ya black; Background-color:white;}. Img-shrink {height:150px; width:100%; border:1px solid White;}. News-footer {font-size:10px;}
The first CSS is our own definition of the subject, must be named Ui-bar-[a-z]. The head word here is divided into three columns, because our first div is <div class= "Ui-grid-b" > This CSS divides the screen into equal three copies.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/57/1C/wKioL1SRmZTR9ErGAADWRX7Ip9E387.jpg "title=" Qq20141217225418.jpg "alt=" Wkiol1srmztr9ergaadwrx7ip9e387.jpg "/>
Then we put our elements in every part.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/57/1E/wKiom1SRlaLweQL3AABBzX3CPA4571.jpg "title=" Qq20141217224012.jpg "alt=" Wkiom1srlalweql3aabbzx3cpa4571.jpg "/>
Effect as above, then this circle picture is how to realize, very simple, css3 very good implementation, will apply the following CSS to the picture can.
. img-corner {border-radius:50%;}
OK, the head also has a nav bar, which actually sets the div's data-role to navbar and then nests <ul><li> in the div.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/57/1B/wKioL1SRl6fjGgEdAABC2akFt6M358.jpg "title=" Qq20141217224608.jpg "alt=" Wkiol1srl6fjggedaabc2akft6m358.jpg "/>
If the navigation bar of the head is clicked, its color will change, this function is implemented by jquery Mobile, we do not need to do anything.
The head is over. We look at the content page, for simplicity, there are some CSS I write directly on the element.
<div style= "font-family: Microsoft Ya Hei" > <p><b> who will buy used cars? These four kinds of people are the smartest consumers </b></p> <div class= "Ui-grid-b" > <div class= "Ui-block-a" > </div> <div class= "Ui-block-b" style= "padding-left:5px;padding-right:5px;" > </div> <div class= "Ui-block-c" > </div> </div> <div class= "News-footer" > <label> First Car Network </label> 200</label> <div style= "Float:right" > <label> just </label> </div> </div> In fact, we observe, we will find that the first line is the title, the second row is three pictures, the third line is some other information.
So the first part of our layout can use <p><div><div> to complete these three parts. The first line is nothing to say, the second line we use the grid system, the screen is divided into three columns, each column of a picture, the last line to note that the "Just +" is on the right, need to use the float= "OK" to see the effect
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/57/1E/wKiom1SRmE_CymWqAAFRcuogNW0422.jpg "title=" Qq20141217225137.jpg "alt=" Wkiom1srme_cymwqaafrcuognw0422.jpg "/>
Yes, it's OK. OK, let's move on to the following layout, the following layout I did not find cross-column functionality like Bootstrap when using the jquery Mobile grid system. So I'll use the 50%/50% grid for the time being.
The first grid we place the text, the second grid we place the picture.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/57/1E/wKiom1SRmXzQqko-AAIKAmPQJo8417.jpg "title=" Qq20141217225636.jpg "alt=" Wkiom1srmxzqqko-aaikampqjo8417.jpg "/>
Note that the above two height, we set the total height of 150, set the height of the text is 135, then the height of the small text is 15, at this time we set the small text is located in the layer of float:left, because the height is not enough, it will automatically sink.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/57/1E/wKiom1SRmozCXkgnAAEsTn1Ezmw098.jpg "title=" Qq20141217230108.jpg "alt=" Wkiom1srmozcxkgnaaestn1ezmw098.jpg "/>
For example, the fine print is sink. OK, in fact, the headline net is the layout of this way, in fact, we just need to create a good type in the database table (is a line of text + 3 images + small text or the left side of the word (typing and fine print) + the right picture), the title, small content, images we can dynamically generate or load the page, This is what I realized under SectionTo.
Finally, we added foot to this page.
@section footer{<div data-role= "Footer" Data-theme= "C" data-position= "fixed" data-fullscreen= "true" > < H3><label style= "color:red" > Headline net, a magical website! </label>650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/57/1E/wKiom1SRm4zQFDyjAADaJDKaTvc931.jpg "title=" Qq20141217230518.jpg "alt=" Wkiom1srm4zqfdyjaadajdkatvc931.jpg "/>
Headline NET, a magical website. This foot will shrink when we set the tap screen. OK, let's look at the effect of all the pages.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/57/1E/wKiom1SRnH7wrp6nAANQK3I6BxE866.jpg "title=" Qq20141217230922.jpg "alt=" Wkiom1srnh7wrp6naanqk3i6bxe866.jpg "/>
Shrink your feet, and we'll see.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/57/1C/wKioL1SRnV6D6wxGAANf4L6h_QM802.jpg "title=" Qq20141217231005.jpg "alt=" Wkiol1srnv6d6wxgaanf4l6h_qm802.jpg "/>
OK, the page will be here today, and finally tell you how to create a mobile project
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/57/1C/wKioL1SRnxbR4WaDAAOi4QTty8U565.jpg "title=" Qq20141217231740.jpg "alt=" Wkiol1srnxbr4wadaaoi4qtty8u565.jpg "/>
Click OK
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/57/1C/wKioL1SRn2nBWP3aAAI-1NJTi6g394.jpg "title=" Qq20141217231903.jpg "alt=" Wkiol1srn2nbwp3aaai-1njti6g394.jpg "/>
Select the mobile app, OK, the project is created.
Finally, if you need the source code to download. Search jquery Mobile demo at 51cto Download Center
This article is from the "Technology Creation value" blog, please be sure to keep this source http://leelei.blog.51cto.com/856755/1591204
WEBAPP (Jquerymobile) actual combat (i)