Tips commonly used in front-end development and tips for front-end development

Source: Internet
Author: User

Tips commonly used in front-end development and tips for front-end development

1. the excess part is shown as omitted (single row ):

white-space: nowrap;text-overflow:ellipsis;overflow: hidden;

The following uses css3 to control the display of the excess part of multiple rows (this is applicable to Google's kernel browser ):

Overflow: hidden; text-overflow: ellipsis; display:-webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;/* set the maximum value, prevent display of excess parts */max-height: 30px;

 

2. The label background is transparent and the content is not transparent:

background: rgba(255,255,255,0.6)!important;

 

3. Call the server Font:

@ Font-face {font-family: "Custom fonts"; src: url ('custom fonts. ttf') format ('opentype ');/* specify the Custom font format */} span {font-family: "Custom font name"; font-size: 36px ;}

 

4. Use css3 for gradient (applicable to Google's kernel browser ):

. Shade {width: 300px; height: 100px;/* gradient of the background */background:-webkit-gradient (linear, 0 0, 0 100%, from (rgba (255,255,255, 0.1), to (rgba (255,163,204, 0.5 )));}

 

5.css 3 enables vertical and horizontal center of images (applicable to Google and Firefox kernel browsers ):

<style type="text/css">    .content{        display: box;        display: -webkit-box;        display: -moz-box;        -webkit-box-pack:center;        -moz-box-pack:center;        -webkit-box-align:center;        -moz-box-align:center;        border: 1px solid red;        width: 600px;        height: 500px;    }</style><body>    <div class="content">            </div></body>

 

Related Article

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.