這篇文章帶給大家的內容是介紹如何仿花瓣網實現靜態登陸頁面? (程式碼實例)。有一定的參考價值,有需要的朋友可以參考一下,希望對你們有幫助。
想法:
花瓣網(http://huaban.com/)
1、對頁面進行分析
2、下載素材
3、分析頁面尺寸
4、實作
下載素材
將頁面素材儲存到本地,方法如下圖
#頁面尺寸進行分析
只做了大概得到尺寸,尺寸取得方法,使用截圖得方法取得寬與高,注意取得過程中圖片得大小不能有變化。將圖片最大化後取得尺寸
實作
寫一個元素,緊接著就css付樣式
##html實作
nbsp;nbsp;html> <meta> <meta> <title>花瓣</title> <meta> <link> <div> <div> <div></div> <div>使用第三方账号登陆</div> <div> <ul> <li><a></a></li> <li><a></a></li> <li><a></a></li> <li><a></a></li> <li><a></a></li> </ul> <div></div> </div> <div>使用手机/邮箱登陆</div> <form> <input> <input> <a> <span>登 陆</span> </a> </form> <div> <a>忘记密码>></a> </div> <div> <span></span>还没有花瓣账号? <a>点击注册>></a> </div> </div> </div>
css樣式
html,body{ margin: 0; padding: 0; } body{ background-color: rgb(86, 228, 221); } .clearn{ float: none; } #login-frame{ width: 600px; height: 430px; margin: 100px auto 0; background-color: #fff; } #main{ margin: 20px 90px auto; } #logo{ width: 150px; height: 135px; margin: 85px auto 0; background-position: 0; background-image: url(img/logo.png); background-repeat: no-repeat; list-style: none; } .lable{ font-size: 14px; color: hsla(0, 0%, 63%, 0.932); text-align: center; position: relative; margin: -30px auto; } .lable::before{ content: ""; border-top: #dadada solid 1px; position: absolute; width: 138px; left: 0; top: 11px; } .lable::after{ content: ""; border-top: #dadada solid 1px; position: absolute; width: 138px; right: 0; top: 11px; } .other-login{ height: 80px; margin: 45px auto 0; } .other-login>ul>li{ list-style: none; float: left; height: 45px; width: 20%; margin: 0 auto; } .other-login>ul>li>a{ width: 60px; height: 70px; display: block; background-image: url(img/login_icons_tiny.png); background-repeat: no-repeat; } .weibo:hover{ background-position:0 -80px; } .qq{ background-position: -80px 0; } .qq:hover{ background-position: -80px -80px; } .wechat{ background-position: -160px 0; } .wechat:hover{ background-position: -160px -80px; } .douban{ background-position: -240px 0; } .douban:hover{ background-position: -240px -80px; } .renren{ background-position: -309px 0; } .renren:hover{ background-position: -309px -80px; } .text-2{ margin: -10px auto; } #main.mail-login{ display: block; width: 100px; } #email{ margin: 25px auto 0; } .mail-login>input{ height: 34px; width: 100%; margin: 10px auto 0; outline: 0; border: 1px solid #dadada; border-radius: 3px; text-indent: 10px; outline: none; } #btn-login{ height: 34px; display: block; text-align: center; line-height: 34px; background: rgb(216, 83, 83); border-radius: 3px; font-size: 18px; color: #fff; text-decoration: none; margin-top: 10px; } #btn-login:hover{ background: rgb(221, 15, 15); } #register-forgetpsd{ margin: 10px auto 30px; font: 10px; } .forget-pwd,.register{ color: rgb(158, 25, 25); float: left; text-decoration: none; list-style-type: none; } .forget-pwd:hover,.register:hover{ text-decoration: underline; } #register{ float: right; } .register{ float: right; } .no-accounter{ color: #292727; }
結果
##
以上是css+html如何仿花瓣網實現靜態登陸頁? (程式碼實例)的詳細內容。更多資訊請關注PHP中文網其他相關文章!

HTMLISNOTAPROGRAMMENGUAGE; ITISAMARKUMARKUPLAGUAGE.1)htmlStructures andFormatSwebContentusingtags.2)itworkswithcsssforstylingandjavascript for Interactivity,增強WebevebDevelopment。

HTML是構建網頁結構的基石。 1.HTML定義內容結構和語義,使用、、等標籤。 2.提供語義化標記,如、、等,提升SEO效果。 3.通過標籤實現用戶交互,需注意表單驗證。 4.使用、等高級元素結合JavaScript實現動態效果。 5.常見錯誤包括標籤未閉合和屬性值未加引號,需使用驗證工具。 6.優化策略包括減少HTTP請求、壓縮HTML、使用語義化標籤等。

HTML是一種用於構建網頁的語言,通過標籤和屬性定義網頁結構和內容。 1)HTML通過標籤組織文檔結構,如、。 2)瀏覽器解析HTML構建DOM並渲染網頁。 3)HTML5的新特性如、、增強了多媒體功能。 4)常見錯誤包括標籤未閉合和屬性值未加引號。 5)優化建議包括使用語義化標籤和減少文件大小。

WebDevelovermentReliesonHtml,CSS和JavaScript:1)HTMLStructuresContent,2)CSSStyleSIT和3)JavaScriptAddSstractivity,形成thebasisofmodernWebemodernWebExexperiences。

HTML的作用是通過標籤和屬性定義網頁的結構和內容。 1.HTML通過到、等標籤組織內容,使其易於閱讀和理解。 2.使用語義化標籤如、等增強可訪問性和SEO。 3.優化HTML代碼可以提高網頁加載速度和用戶體驗。

htmlisaspecifictypefodyfocusedonstructuringwebcontent,而“代碼” badlyLyCludEslanguagesLikeLikejavascriptandPytyPythonForFunctionality.1)htmldefineswebpagertuctureduseTags.2)“代碼”代碼“ code” code code code codeSpassSesseseseseseseseAwiderRangeLangeLangeforLageforLogageforLogicIctInterract

HTML、CSS和JavaScript是Web開發的三大支柱。 1.HTML定義網頁結構,使用標籤如、等。 2.CSS控製網頁樣式,使用選擇器和屬性如color、font-size等。 3.JavaScript實現動態效果和交互,通過事件監聽和DOM操作。

HTML定義網頁結構,CSS負責樣式和佈局,JavaScript賦予動態交互。三者在網頁開發中各司其職,共同構建豐富多彩的網站。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

SAP NetWeaver Server Adapter for Eclipse
將Eclipse與SAP NetWeaver應用伺服器整合。

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

Atom編輯器mac版下載
最受歡迎的的開源編輯器

Dreamweaver CS6
視覺化網頁開發工具

EditPlus 中文破解版
體積小,語法高亮,不支援程式碼提示功能