Image upload progress display with minimal HTML tags

Source: Internet
Author: User

HTML structure:

    <Divclass= "Parent">        <imgclass= "image"src= "http://h.hiphotos.baidu.com/baike/c0%3Dbaike80%2C5%2C5%2C80%2C26/sign=94d19969d40735fa85fd46ebff3864d6/ 8644ebf81a4c510fe630d9686059252dd52aa5cf.jpg "/>        <Divclass= "Progress">75%</Div>    </Div>

CSS section:

. Parent{/*set the absolute positioning of the relative positioning Mate Progress display block*/position:relative;/*set the float, let the width shrink, wrap the picture, otherwise too wide, it will appear the width of the progress display block is greater than the width of the picture*/float: Left;}. Image{/*sets the maximum width to prevent the width from being too large to exceed the parent element*/Max-width:100%;/*set float to prevent other blank text from taking up space inside the line, with extra narrow bars*/float: Left;}. Progress{/*make the progress display block full of the parent element with absolute positioning and overlap with the picture*/position:Absolute;Top:0; Left:0;width:100%;Height:100%;/*default setting a full translucent occlusion layer blocks the image to differentiate between upload completion and uploading status*/Background-color:rgba (0, 0, 0, 0.2);/*Set Progress Translucent layer*/background-size:100% 75%;/*75% consistent with progress*/Background-image:linear-gradient (0deg, Rgba (0,0,0,0.3) 0, Rgba (0,0,0,0.3) 100%);background-repeat:no-repeat;background-position:0 100%;/*setting progress information with the elastic box Telescopic Model Absolute Center in the horizontal vertical direction*/Display:-webkit-box;Display:Flex;-webkit-box-orient:Horizontal;-webkit-box-direction:Normal;flex-direction:Row;-webkit-box-pack:Center;justify-content:Center;-webkit-box-align:Center;Align-items:Center;Flex-wrap:nowrap;/*set the progress display color to white to prevent problems that are not easy to see*/Color:#FFF;}

Originally want to use CSS attr function, let progress information only appear in one place, but currently attr function can not be used in the properties outside the content, had to stop.

Image upload progress display with minimal HTML tags

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.