Mirror app html style CSS div mask background layer style

Source: Internet
Author: User

After setting the background picture, if the background picture is too bright, it is recommended that you put a div mask background layer-the style of the Div mask layer in the CSS currently released by Google:

1 /*Overlay gradient to allow text to is read over the image.*/2 3 /*For cards with lines of text (excluding footer)4 * Ex:hybrid templates & Those needing more bottom readability5  */6 Div.overlay-gradient-tall{7 Display:Block;8 position:Absolute;9 Top:30%;Ten  Left:0; One  Right:0; A Bottom:0; - background:-webkit-linear-gradient (Rgba (0,0,0,0.0), Rgba (0,0,0,0.8)); -} the  - /*A Darker variant of the above gradient to improve readability.*/ - Div.overlay-gradient-tall-dark{ - Display:Block; + position:Absolute; - Top:0; +  Left:0; A  Right:0; at Bottom:0; - background:-webkit-linear-gradient (Rgba (0,0,0,0.2) 30%, Rgba (0,0,0,0.85) 100%); -} -  - /*For cards with one line of text (excluding footer) - * Ex:photos, videos, people in  */ - Div.overlay-gradient-medium{ to Display:Block; + position:Absolute; - Top:50%; the  Left:0; *  Right:0; $ Bottom:0;Panax Notoginseng background:-webkit-linear-gradient (Rgba (0,0,0,0.0), Rgba (0,0,0,0.8)); -} the  + /*For cards with low text A * Ex:footer, ToolTips the  */ + Div.overlay-gradient-short{ - Display:Block; $ position:Absolute; $ Top:70%; -  Left:0; -  Right:0; the Bottom:0; - background:-webkit-linear-gradient (Rgba (0,0,0,0.0), Rgba (0,0,0,0.6));Wuyi} the  - /*For cards with full-height or near-full-height text on top of a photo or Wu * Mosiac.*/ - Div.overlay-full{ About Display:Block; $ position:Absolute; - Top:0; -  Left:0; -  Right:0; A Bottom:0; + Background-color:rgba (0, 0, 0, 0.7); the}

1 First style <class= "Overlay-gradient-tall"></Div  >

The display results are as follows:

1 Second style <class= "Overlay-gradient-tall-dark"></ Div >

1 Third style <class= "Overlay-gradient-short"></  div>

1 last style (recommended)<class= "Overlay-full"></Div >

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.