前端學(xué)習(xí)筆記之4 靜態(tài)頁(yè)面練習(xí)(百度)

引言 : 博主目前是一名iOS開(kāi)發(fā)者, 所會(huì)的語(yǔ)言有Objective-C 和 Swift, 目前正在學(xué)習(xí)前端; 這篇文章只是作為我的筆記發(fā)在這里, 供自己業(yè)余時(shí)間看看; 全是很基礎(chǔ)的東西, 看到的小伙伴 酌情略過(guò)_

效果圖

這里寫圖片描述

1. index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>百度一下,你就知道</title>
    <link href="css/index.css" rel="stylesheet">
</head>
<body>
    <!--頭部-->
    <div id="header">
        <!--javascript:void(0) 點(diǎn)擊的時(shí)候啥也不干-->
        <a href="#">新聞</a>
        <a href="#">hao123</a>
        <a href="#">地圖</a>
        <a href="#">視頻</a>
        <a href="#">貼吧</a>
        <a href="#">登錄</a>
        <a href="#">新聞</a>
        <a href="#" class="more-product">更多產(chǎn)品</a>
    </div>
    <!--主要內(nèi)容-->
    <div id="content">
        <div class="logo">
            ![](images/logo.png)
        </div>
        <div class="search">
            <input type="text" value="">
            <a href="#">百度一下</a>
        </div>
        <div class="dom">
            ![](images/d_1.JPEG)
            ![](images/d_2.JPEG)
            ![](images/d_3.JPEG)
            ![](images/d_4.JPEG)
        </div>
        <div class="dom">
            ![](images/d_5.JPEG)
            ![](images/d_6.JPEG)
            ![](images/d_7.JPEG)
            ![](images/d_8.JPEG)
        </div>
    </div>
    <!--尾部-->
    <div id="footer">
        <p class="footer-top">
            <a href="#">把百度設(shè)置為主頁(yè)</a>
            <a href="#">關(guān)于百度</a>
            <a href="#">About Baidu</a>
        </p>

        <p class="footer-bottom">
            @2017 Baidu <a href="#">使用百度前必讀</a> 意見(jiàn)反饋 京ICP證18264號(hào)
        </p>

    </div>
</body>
</html>

2. index.css

* {
    margin: 0px;
    padding: 0px;
}

body {
    /*背景圖片, 其中 ../ 是返回到上一層目錄*/
    /*background: url("../images/d_1.JPEG");*/
}

/*頭部*/
#header{
    text-align: right;
    height: 30px;
    line-height: 30px;
    margin-top: 1px;
}
#header a{
    margin: 0px 15px 0px 0px;
}

#header a.more-product{
    display: inline-block;
    color: white;
    background-color: rgb(51, 136, 255);
    height: 30px;
    line-height: 30px;
    padding: 0px 20px;
    text-decoration: none;
    margin-right: 0px;
}

/*主要內(nèi)容*/
#content{
    text-align: center;
}
#content .logo img{
    width: 270px;
    height: 129px;
    margin: 15px auto 0px;
}
#content .search {
    width: 600px;
    height: 40px;
    margin: 0px auto;
    margin-bottom: 40px;
}
#content .search input{
    width: 500px;
    height: 40px;
    padding: 9px 7px;
    border: solid rgb(204, 204, 204) 1px;
    margin: 0px;
    /*向外擴(kuò)展*/
    box-sizing: border-box;
}
/*焦點(diǎn)*/
#content .search input:focus{
    outline: none;
    border: solid 1px rgb(51, 136, 255);
}
#content .search a {
    display: inline-block;
    color: white;
    background-color: rgb(51, 136, 255);
    width: 100px;
    height: 40px;
    line-height: 40px;
    text-decoration: none;
    text-align: center;
    float: right;
}
/*鼠標(biāo)放上去的時(shí)候*/
#content .search a:hover {
    background-color: rgba(51, 136, 255, 0.7);
}
#content .dom img {
    width: 150px;
    height: 100px;
    margin: 5px 10px;
}
/*鼠標(biāo)放上去的時(shí)候*/
#content .dom img:hover{
    /*設(shè)置不透明度*/
    opacity: 0.7;
}
/*尾部*/
#footer{
    margin-top: 120px;
    text-align: center;
}
#footer p{
    margin-top: 5px
}
#footer p.footer-top{
    margin: 0px 5px;
}

a:hover {
    opacity: 0.7;
}

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 發(fā)現(xiàn) 關(guān)注 消息 iOS 第三方庫(kù)、插件、知名博客總結(jié) 作者大灰狼的小綿羊哥哥關(guān)注 2017.06.26 09:4...
    肇東周閱讀 15,422評(píng)論 4 61
  • 【楔子】 我沉在湖底,腦海里滿滿都是那抹素白的身影。西湖水淹金山寺那天,我對(duì)她承諾,無(wú)論刀山火海,都會(huì)陪她一起挺過(guò)...
    Awo十里閱讀 1,736評(píng)論 28 46
  • 很喜歡這句話。我最近在看《金星秀》,看到了張靚穎的那一期,我突然很喜歡她。 我對(duì)張靚穎的認(rèn)識(shí)還停留在那年...
    Mindmelody閱讀 295評(píng)論 0 0
  • 通過(guò)向沃倫個(gè)查理學(xué)習(xí),不僅僅在于能夠了解大量關(guān)于如何在長(zhǎng)時(shí)間內(nèi)讓金錢以很高的復(fù)利增長(zhǎng)的知識(shí)。而在于通過(guò)聽(tīng)取他們...
    俞mm閱讀 308評(píng)論 0 0
  • 算上這一次 可能有 很多次錯(cuò)過(guò)火車 因?yàn)闀r(shí)間 因?yàn)橘I錯(cuò)票 好像所有的理由都必須親自體驗(yàn)一邊 才能明白 這是所謂理由...
    檸檬紅茶坊的一顆豆閱讀 204評(píng)論 3 0

友情鏈接更多精彩內(nèi)容