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