Efficient CSS development practices: CSS 3, LESS, SASS, Bootstrap, Foundation, and sassbootstrap

Source: Internet
Author: User

Efficient CSS development practices: CSS 3, LESS, SASS, Bootstrap, Foundation, and sassbootstrap

Compared with traditional image backgrounds, constructing a background color using CSS not only reduces the overhead of network transmission, but also attracts developers for its controllability.

As shown in figure 5.18, the designer designed a background image as the title background. For users who use computers to browse Web pages, there is basically no line break in the title, and the layout is basically fixed width. Therefore, they can directly use the background image given by the designer. However, this page is mainly displayed on the mobile phone. The title may take one or three rows according to the length. If you use an image, you must place different background images based on different situations, implementation is complicated.

 

Figure 5.18 background given by the designer

Fortunately, this background image is actually gradient from left to right from the dark purple blue to the light blue and then gradient to the dark blue, then you can directly use a linear gradient of multiple color values to define the style:

 

. Header {background-image:-webkit-linear-gradient (left, #241a38, #012c57, #031a40); background-image:-o-linear-gradient (left, #241a38, #012c57, #031a40); background-image:-moz-linear-gradient (left, #241a38, #012c57, #031a40); background-image: linear-gradient (left, #241a38, #012c57, #031a40 );}

The CSS scheme is used to replace the image. If the title is broken, the title area is automatically supported. No matter how many lines can be perfectly adapted, It is very flexible, and greatly reduces the complexity of the implementation, but also saves the network traffic caused by image loading, it can be described as one to more.

 

 

Exchange with others

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.