CSS makes Huawei Mate8 mobile phone model
1.HTML Code
<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "UTF-8"> <title></title> </Head> <Body> <Divclass= "Phone"> <Divclass= "Body"></Div> <Divclass= "Head"></Div> <Divclass= "Cinema"></Div> <Divclass= "button"></Div> <Divclass= "Screen"></Div> <Divclass= "Probutton"></Div> <Divclass= "Brobutton"></Div> </Div> <HR> <Divclass= "Rotatebutton"></Div> </Body></HTML>
2.CSS Code
*{List-style:none; Text-decoration:none; font-family: "Microsoft ya Black UI"; font-size:14px; padding:0; margin:0;} body {padding:20px; margin:0 Auto;}. phone {position:relative;}. body {width:240px; height:400px; Background-color: #daa520; border-radius:5%;}. screen {width:240px; height:340px; Background-color: #444; Position:absolute; top:30px; left:0;}. Screen:before {content: ' HUAWEI '; Font-style:italic; Position:absolute; top:160px; left:100px; Color: #FFFFFF;}. Cinema {background-color: #444; border-radius:50%; Position:absolute; top:10px; left:60px; width:10px; height:10px;}. Cinema:before {content: '; Background-color: #444; border-radius:50%; Position:absolute; top:0; left:115px; width:10px; height:10px;}. Cinema:after {content: '; Background-color: #444; border-radius:15px; Position:absolute; top:2px; left:28px; width:70px; height:5px;}. button {border-radius:0 10px 10px 0; width:3px; height:50px; Position:absolute; top:40px; left:240px; Background-color: #DAA520;}. Button:before {content: '; border-radius:0 10px 10px 0; width:3px; height:30px; Position:absolute; top:60px; left:0; Background-color: #DAA520;}. Probutton {width:15px; height:15px; border-radius:50%; border:2px solid #ffd700; Position:absolute; top:375px; left:108px;}. Probutton:before {content: '; width:13px; height:13px; border-radius:20%; border:2px solid #FFD700; Position:absolute; Top: -2px; Left: -80px;}. Probutton:after {content: '; Border-style:solid; border-width:12px; Border-color:transparent #FFD700 Transparent transparent; width:0; height:0; Position:absolute; Top: -4px; left:74px;}
Note: Pseudo-class before, after use, reduce the amount of label usage.
Best wishes.
Laoyu
This article is for the program Ape Original, hereby declares. Reprint please indicate the source, thank you!
CSS making Huawei Mate8 Phone model Example