Summary of mobile time-to-do during internship

Source: Internet
Author: User


The style of the picture to be displayed as a design (the picture is named: inset.png) but actually after the PSD is cropped, the size of the picture is 773x305px in order for the picture to show the same effect as the design, the code reads:
1 class="pic"></div>2. pic{3     0  0 no-repeat; 4    width:386.5px;/*no*/was designed to be half the width of the original picture. 5     height:157.5px;/*no*/was designed to be half the height of the original picture. 6     Background-size:cover; 7 }
2, the outer div height can not be elevated by the content of the inner layer may be the result of floating inside elements, there are 3 ways to solve: the first: the outer div set styleOverflow:auto;But this will only simulate when you will find that once the content becomes more, the side of the scroll bar, the experience is not good, not recommended. The second kind: find floating content in the outer Div, add it after floating<div style= "Clear:both" ></DIV>But adding new empty div is not very good either. The third type: Define a pseudo-class
1 1 ;} 2 0 0 "";}

The outer layer of the original Div adds the Clearfix class,

class="clearfix">...</div>
3. In the comment area, want to make each comment area is a large div, and then each div between the line through Border-bottom to achieve, just start not, with an empty Div, wrote dead fixed height support high div to achieve: The HTML code is as follows:
1<divclass="Comment">2  3<divclass=" Left">4".. /i/person2.png" class=" Person">5</div>6  7<divclass=" Right">8<divclass="Info">9<pclass="username"> Popsicle Soda </p>Ten<pclass="Date"style="padding-left:100px"> ./ ./ in</p> One</div> A<divclass="critics">China's thickness is very thick, but the top is not much. The absence of such people as the South Korean park, Stone and the Sea of Neptune needles.  -<divclass="input"> -<divclass="Input-info"> the<pclass="Input-username"> Popsicle Soda </p> -<pclass="input-date"> ./ ./ in</p> -</div> -<divclass="Input-critics">China's thickness is very thick, but the top is not much. The absence of such people as the South Korean park, Stone and the Sea of Neptune needles.  +</div> -</div> +</div> A</div> at</div>

The CSS code is as follows:

1 . person{2 width:76px;3 height:76px;4Border-radius: -%;5     float: Left;6margin:30px030px 30px;7 }8 . right{9     float: Left;Ten } One . info{ AMargin-top:-40px; -padding-left:20px; - } the. username,.input-username{ - Display:inline; -font-size:26px; -font-Weight:bold; +   - } +. date,.input-date{ Afont-size:24px; at Display:inline; - } - . date{ - color: #b2b6b7; -padding-left:95px; - } in . critics{ -font-size:24px; to width:475px; +padding-left:20px; - } the  

Ask the Wutai found, because it is because the content of the large div set the float:left, equivalent to the original box contains no floating normal elements, when the element floats, it floated to the top. To get the element back in the box, you need to add a pseudo-class

<div class= "comment Clearfix" > .... </div>you can do it! questions to comment on

Set the Publish div position for the comment below to fixed,bottom:0, fixed at the bottom of the page and found at this pointproblem: will block more comments on the above sectionthe original HTML code:
1<divclass="more-com">2<p> More Reviews </p>3".. /i/more_btn.png" class="more-btn">4</div>5<divclass="Devide1"></div>6<divclass="Publish">7<input type="text" class="speak"Placeholder="post a comment ...">8<divclass="Send"></div>9</div>
original CSS style:
1 /*more Comments*/2. more-com{3font-size:24px;4     /*float:left;*/5 width:160px;6 margin:20px 250px;7 height:36px;8  9 }Ten. more-com p{ One     float: Left; Afont-size:24px; - } -. more-btn{ the Display:inline; -padding-left:10px; - } - . publish{ +Width -%; - Height:auto; +Margin0Auto; APositionfixed; atBottom0; -Z-index:0; -     -border-top:1px solid #DEE6E8; -border-bottom:1px solid #DEE6E8; -padding-bottom:20px; in } - . speak{ to width:480px; + height:60px; -line-height:60px; thefont-size:24px; *border:1px solid #DEE6E8;/*No*/ $background-color: #EEEEEE;Panax Notoginseng     float: Left; -margin:20px0 040px; the   + } A . send{ theBackground:url (.. /i/send.png)0 0no-repeat; + width:46px; - height:46px; $background-Size:cover; $     float: Left; -margin:30px0 030px; - Cursor:pointer; the}

This will cover up!!

The reason is that more-com is a box, in order to let the inside of the P element and the button picture on the same line, so add the Float:left to P, add display:inline to the picture, but on the more-com haveFloat:leftStyle, so that the whole is floating up, remove this style, so that the large div back to normal state, wrapped in the same line of elementsSolution: Remove more-com above the float-left; (above the CSS red Word display)3. When the mobile adapter is found, there is a scroll bar in the left and right horizontal direction, and the reason is this: the Middle separator bar
1 class="devide"></div>2CSS format:3. devide,{4    height:24px; 5     %; 6     border:1px solid #DEE6E8; 7 }8  
Here Comes the box model divided into 2 types: Standard mode and weird modeStandard mode: Box total width/height =width/height+padding+border+marginWeird mode: Box total width/height =width/height + marginso the width of the Div plus the left and right sides of the border, resulting in horizontal direction of the left and right scroll barWorkaround: Like the rest of the code, the border part is changed to border-top:1px solid #dee6e8; and border-bottom:1px solid #dee6e8;

Summary of mobile time-to-do during internship

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.