Today, the previous article, "Web front-end entry-level exercise _ Thunder Official Xuan Network Design" officially began the first version of Thunderbolt home design. If this is done, the final
First step: Complete the design of the logo section first
- Logo design, we will use the positioning of the CSS to achieve, but in the implementation of the positioning, the first need to write the structure of the Web page
<body><div class= "Rightone" > More </div><div class= " Righttwo "> Product Center </div></body>
- Add style, style file Xunlei.css
* {margin:0;padding:0;} HTML, body {Width:100%;height:100%;overflow:hidden;} div {height:100%;}. Logo {position:fixed;left:30px;top:20px;z-index:999;}. Rightone {position:fixed;left:95%;margin-top:40px;color: #ffffff; z-index:999;}. Righttwo {position:fixed;left:85%;margin-top:40px;color: #ffffff; z-index:999;}
Explain the code ideas above
- Eliminate the default margins and padding for all elements first *{...}, which is a seamless combination of elements and browser distances
- Because the Thunder official home a kind of split screen sliding display features, so we need to set the HTML and body of the overflow, so that beyond the browser visible area of the content hidden away
- Set the height of the div uniformly, if there is no height then add the background to the DIV is not able to set the success
- Finally, three selectors were defined to fix their position on the screen.
Step two: Design the first screen main area
- The main area will have a video playback
- Then, in the top of the video will be nested on the thunder of some text description
- This design also uses CSS's positioning to complete
Look at the page structure of the first main screen area first
<body><div class= "Rightone" > More </div><div class= " Righttwo "> Products </div><div class=" main "><!--first screen--><div class=" page Page1 "><div class=" Video "><video loop=" loop "autoplay=" AutoPlay "><source src=" IMG/BG "type=" "></video><p class = "Onetop" > Technology • Sharing • Entertainment </p><p class= "Onebottom" > Download Thunderbolt products </p><p class= "Onebottomone" >>< /p></div></div> </div> </body>
Style code for CSS
* {margin:0;padding:0;} HTML, body {Width:100%;height:100%;overflow:hidden;} div {height:100%;}. Logo {position:fixed;left:30px;top:20px;z-index:999;}. Rightone {position:fixed;left:95%;margin-top:40px;color: #ffffff; z-index:999;}. Righttwo {position:fixed;left:85%;margin-top:40px;color: #ffffff; z-index:999;}. Page1 {background-color:black;}. Video {Width:100%;height:100%;overflow:hidden;}. Video video {Width:100%;height:100%;object-fit:fill;}. onetop {width:100%;height:180px;position:absolute;left:50%;top:50%;margin-left: -50%;margin-top: -90px;text-align : Center;line-height:180px;color: #ffffff; font-size:8rem;font-family: ' Blackbody ';}. Onebottom {width:188px;height:54px;position:absolute;left:50%;top:70%;margin-left: -94px;margin-top: -27px; font-size:22px;font-family: ' blackbody '; color: #ffffff; text-align:center;line-height:54px;border:1px solid #ffffff;}. Onebottom:hover {Background-color:rgba (255, 255, 255, 0.3);}. Onebottomone {width:100%;height:180px;position:Absolute;left:50%;top:80%;margin-left: -50%;margin-top: -90px;color: #ffffff; font-size:3rem;font-family: ' Blackbody '; Text-align:center;line-height:180px;transform:rotate (90deg);}
[Liu Yang Java]_web front-end entry-level exercise _ Thunderbolt Home first screen design