day05

A我今天學(xué)習(xí)到了什么

1溫習(xí)day04的知識點
1.1.盒子模型
盒子模型:box-sizing:border-box
當(dāng)設(shè)置box-sizing:border-box;
設(shè)置padding,和border,//它的寬度還是會保持不變
box-sizing:content-box;(默認清晰)
//當(dāng)設(shè)置padding和border時寬度會發(fā)生改變
//總寬度=width+border+padding
1.2.浮動float
1.目的:為了讓元素并排顯示
float:lest|right火本;
(postion:relative// 相對的位置移動
top|left|right|bottom:1px典勇;)
2如何清除浮動
(1)給下面的兄弟元素給clear:both;
(2)給父級加overflow:hidden;
(3)用偽元素,給父級內(nèi)容生成
.row:before{
 display:table; 
 content:“”}//前面加
.row:after{
 display:table;
 content:“”
 clear:both;}//后面加
1.3.定位:position
position:absolute | relative
//絕對定位虱肄,相對定位
Relative 定位
相對定位元素的定位是相對其正常位置沮翔。
postion:relative//父級專屬位置設(shè)定
Absolute定位 (fixed固定//沒有父級只有<html>)
絕對定位的元素的位置相對于最近的相對定位的父元素丘薛,
如果沒有已定位的父元素近弟,那么它的位置相對于<html>
****定位的調(diào)試都通過left,top,right,bottom移動
z-index:設(shè)置元素的堆疊順序 給position:absolute絕對定位的元素
當(dāng)子元素沒有設(shè)置寬度耗美,如果設(shè)置了絕對定位,它不會繼承父元素的寬度
1.4.布局方式的總結(jié)
1.默認布局
2.浮動布局(左右安置)
3.層級布局(定位)
1.5.實現(xiàn)元素的垂直水平居中
(相對)父元素設(shè)置parent{position:relative;}
(絕對)子元素設(shè)置child{
position:absolute;left:50%;top:50%;
margin-left:-50%*child*width;
margin-top:-50%*child*height;}
1.6:CSS樣式的幾種引入方式
外部樣式表
<link rel="stylesheet" type="text/css" href="/c5.css">
內(nèi)部樣式表(位于 <head> 標簽內(nèi)部)
<style>
p{color:pink;font-size:16px}
</style>
內(nèi)聯(lián)樣式(在 HTML 元素內(nèi)部)
<p style=”color:pink;font-size:16px”>hello world</p>
//給同一選擇器設(shè)置同一樣式,離元素近的樣式設(shè)置方式優(yōu)先級高
2拓展day04的知識點
2.1 p:margin的一點漏洞問題
給子元素margin-top:父元素移動,子元素不移動
解決方案:1.給父元素overflow:hidden;
                  2.給父元素設(shè)置偽元素parent:before{content:'‘”;display:table}
上面的元素的margin-bottom和下面元素的margin-top會重合
//取兩者的最大值
2.2一個登陸頁面
<form >
    <p><label for="text">文本</label><input id="text" type="text"/></p>
//<label for="text">文本</label>特殊人員的照顧盛龄,指引
//"text"這個是input對話框的文本屬性
    <p><label for="password">密碼</label><input id="password" type="password"/></p>
//"password"這是input對話框的密碼屬性
    <p><input type="submit" value="登錄"/></p>
//"submit"是input按鈕的屬性,value更改名
</form>

//定義和用法
<label> 標簽為 input 元素定義標注(標記)序调。
label 元素不會向用戶呈現(xiàn)任何特殊效果醉锅。不過,它為鼠標用戶改進了可用性发绢。
如果您在 label 元素內(nèi)點擊文本硬耍,就會觸發(fā)此控件垄琐。
<label> 標簽的 for 屬性應(yīng)當(dāng)與相關(guān)元素的 id 屬性相同。

2.3單選框
<!--單選框需給一樣的“name”名-->
    <p>
        <label for="male">男</label><input id="male" type="radio" name="sex" value="男">
        <label for="female">女</label>
        <input id="female" type="radio" name="sex" value="女">
    </p>
2.4復(fù)合選框
<!--復(fù)合選框-->
    <p>
        <label>愛好</label>
        <input type="checkbox" name="愛好" value="游泳">游泳
        <input type="checkbox" name="愛好" value="開車">開車
    </p>
2.5下拉選框
<select>
            <option>洪山區(qū)</option>
            <option>青山區(qū)</option>
            <option>漢陽區(qū)</option>
</select>
2.6預(yù)選的下拉選框
<form action="">
<select>
            <option>洪山區(qū)</option>
            <option selected>青山區(qū)</option>
            <option>漢陽區(qū)</option>
        </select>
</form>
//在想要的option上加selected這個屬性
2.7文本域
文本域
<textarea   placeholder="看點槽點经柴,不吐不快狸窘!別憋著,馬上大聲說出來吧坯认!"></textarea>
*****拓展
&nbsp空格 &lt<  &gt>

特殊案例

1.input 輸入框

input type=”text”
         type=”submit”之間的區(qū)別
一個文本是content box翻擒,一個按鈕是border box

2.display和visibility的區(qū)別

display:none;//塊不存在
visibility:hidden;//只是隱藏起來了

3.講解登錄框下面的幾個icon


image.png
//是背景圖片的取圖定位,左負右正background-position: -18px 0

B我掌握了的

1.1 p:margin的一點漏洞問題
給子元素margin-top:父元素移動,子元素不移動
解決方案:1.給父元素overflow:hidden;
                  2.給父元素設(shè)置偽元素parent:before{content:'‘”;display:table}
上面的元素的margin-bottom和下面元素的margin-top會重合
//取兩者的最大值
1.2一個登陸頁面
<form >
    <p><label for="text">文本</label><input id="text" type="text"/></p>
//<label for="text">文本</label>特殊人員的照顧牛哺,指引
//"text"這個是input對話框的文本屬性
    <p><label for="password">密碼</label><input id="password" type="password"/></p>
//"password"這是input對話框的密碼屬性
    <p><input type="submit" value="登錄"/></p>
//"submit"是input按鈕的屬性陋气,value更改名
</form>

//定義和用法
<label> 標簽為 input 元素定義標注(標記)。
label 元素不會向用戶呈現(xiàn)任何特殊效果引润。不過巩趁,它為鼠標用戶改進了可用性。
如果您在 label 元素內(nèi)點擊文本淳附,就會觸發(fā)此控件议慰。
<label> 標簽的 for 屬性應(yīng)當(dāng)與相關(guān)元素的 id 屬性相同。

1.3單選框
<!--單選框需給一樣的“name”名-->
    <p>
        <label for="male">男</label><input id="male" type="radio" name="sex" value="男">
        <label for="female">女</label>
        <input id="female" type="radio" name="sex" value="女">
    </p>
1.4復(fù)合選框
<!--復(fù)合選框-->
    <p>
        <label>愛好</label>
        <input type="checkbox" name="愛好" value="游泳">游泳
        <input type="checkbox" name="愛好" value="開車">開車
    </p>
1.5下拉選框
<select>
            <option>洪山區(qū)</option>
            <option>青山區(qū)</option>
            <option>漢陽區(qū)</option>
</select>
1.6預(yù)選的下拉選框
<form action="">
<select>
            <option>洪山區(qū)</option>
            <option selected>青山區(qū)</option>
            <option>漢陽區(qū)</option>
        </select>
</form>
//在想要的option上加selected這個屬性
1.7文本域
文本域
<textarea   placeholder="看點槽點燃观,不吐不快褒脯!別憋著,馬上大聲說出來吧缆毁!"></textarea>
*****拓展
&nbsp空格 &lt<  &gt>

特殊案例

1.input 輸入框

input type=”text”
         type=”submit”之間的區(qū)別
一個文本是content box番川,一個按鈕是border box

2.display和visibility的區(qū)別

display:none;//塊不存在
visibility:hidden;//只是隱藏起來了

3.講解登錄框下面的幾個icon


image.png
//是背景圖片的取圖定位,左負右正background-position: -18px 0

C我沒有掌握的

全部不掌握了脊框,不熟練要多練習(xí)颁督。

    margin: 0;
    padding: 0;
}
.wai{
    position: relative;
    height: 100px;
}
.wa{
    box-sizing: border-box;
    position: absolute;
    left: 400px;
    top: 30px;
    clear: both;
}
.wa>img{
    width: 49px;
    height: 49px;
    background: #f56600;
}
.wa>.wa1{
    display: inline-block;
    overflow: hidden;
    padding-left: 10px;
}
.wa1>.wa-1 {
    font-size: 28px;
    position: absolute;
    top: -5px;
}
.wa1>.wa2{
    font-size: 10px;
}
.bac{
    position: relative;
    background: url("../images/banner.png") no-repeat center;
    height: 600px;
    /*margin: 30px 0;*/
}
.den{
    position: absolute;
    width: 350px;
    height: 500px;
    right: 430px;
    top:50px;
    background: #ffffff;
    text-align: center;
}
.login{
    margin: 30px 0;
}
.login span{
    font-size: 24px;
    margin: 0 10px;
}
form p{
    margin: 10px 0;
    box-sizing: border-box;
}
form input{
    width: 280px;
    height: 50px;
    border: 1px solid #e0e0e0;
    outline: none;
}
.password>input{
    padding-left: 15px;
}
.phone>input{
    padding-left: 15px;
}
.login .active{
    color: #f56600;
}
.submit>input{
    width: 297px;
    height: 50px;
    background: #f56600;
    color: white;
    font-size: 18px;
    margin: 20px 0 10px;
}
.register {
    margin-bottom: 70px;
}
.register .wang{
    background: blue;
    color: white;
}
.footer {
    width: 300px;
    margin-left: auto;
    margin-right: auto;
}
.footer .line{
    border-bottom:none;
    border-right: none;
    border-left:none;
}
.All{
    overflow: hidden;
    margin-top: 15px;
}
.All a{
    width: 20px;
    height: 20px;
    display: inline-block;
    background: #747474 url(../images/icons_type.png) no-repeat;
    margin-left: 30px;
}
.All .one {
    margin-left: 0;
    background-position: -18px 0
}

.All .two {
    background-position: -37px 0
}

.All .three {
    background-position: -57px 0
}

.All .four {
    background-position: -85px 0
}
.xia{
    height: 200px;
    position: relative;
}
.xia1{
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -37px;
    margin-left: -379px;;

}
.xia1 p{
    margin: 10px 0;
}
.xia1 span{
    margin: 5px;
}
<div class="wai">
    <div class="wa">
        ![](images/mi-logo.png)
        <p class="wa1">
            <span class="wa-1">小米商城</span>
            <span class="wa-2">讓每個人都能享受科技的樂趣</span>
        </p>
    </div>
</div>
    <div class="bac">
        <div class="den">
            <form>
                <P class="login">
                    <span class="active">帳號登錄</span>
                    <span class="...">|</span>
                    <span class="saoma">掃碼登錄</span>
                </P>
                <p class="phone">
                    <input type="text" placeholder="郵箱/手機號碼/小米賬號"/>
                </p>
                <p class="password">
                    <input type="text" placeholder="密碼"/>
                </p>
                <p class="submit">
                    <input type="submit" value="立即登錄"/>
                </p>
            </form>
            <p class="register">
                <span>注冊小米賬號</span>
                <span>|</span>
                <span class="wang ">忘記密碼?</span>
            </p>
            <div class="footer">
                <fieldset class="line">
                    <legend align="center" class="line_txt">其他方式登錄</legend>
                </fieldset>
                <div class="All">
                    <a href="#" class="one"></a>
                    <a href="#" class="two"></a>
                    <a href="#" class="three"></a>
                    <a href="#" class="four"></a>
                </div>
            </div>
        </div>
    </div>
    <div class="xia">
        <div class="xia1">
            <p class="xia-1">
                <span>簡體</span>
                <span>|</span>
                <span>繁體</span>
                <span>|</span>
                <span>English</span>
                <span>|</span>
                <span>常見問題</span>
            <p>小米公司版權(quán)所有-京ICP備10046444-
![](http://upload-images.jianshu.io/upload_images/
7881909-41d1192feb36aa47.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
京公網(wǎng)安備11010802020134號-京ICP證110507號</p>
            </p>
        </div>
    </div>
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市浇雹,隨后出現(xiàn)的幾起案子沉御,更是在濱河造成了極大的恐慌,老刑警劉巖昭灵,帶你破解...
    沈念sama閱讀 221,331評論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件吠裆,死亡現(xiàn)場離奇詭異,居然都是意外死亡烂完,警方通過查閱死者的電腦和手機试疙,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,372評論 3 398
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來抠蚣,“玉大人祝旷,你說我怎么就攤上這事。” “怎么了怀跛?”我有些...
    開封第一講書人閱讀 167,755評論 0 360
  • 文/不壞的土叔 我叫張陵距贷,是天一觀的道長。 經(jīng)常有香客問我吻谋,道長忠蝗,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 59,528評論 1 296
  • 正文 為了忘掉前任滨溉,我火速辦了婚禮什湘,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘晦攒。我一直安慰自己,他們只是感情好得哆,可當(dāng)我...
    茶點故事閱讀 68,526評論 6 397
  • 文/花漫 我一把揭開白布脯颜。 她就那樣靜靜地躺著,像睡著了一般贩据。 火紅的嫁衣襯著肌膚如雪栋操。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 52,166評論 1 308
  • 那天饱亮,我揣著相機與錄音矾芙,去河邊找鬼。 笑死近上,一個胖子當(dāng)著我的面吹牛剔宪,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播壹无,決...
    沈念sama閱讀 40,768評論 3 421
  • 文/蒼蘭香墨 我猛地睜開眼葱绒,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了斗锭?” 一聲冷哼從身側(cè)響起地淀,我...
    開封第一講書人閱讀 39,664評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎岖是,沒想到半個月后帮毁,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 46,205評論 1 319
  • 正文 獨居荒郊野嶺守林人離奇死亡豺撑,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,290評論 3 340
  • 正文 我和宋清朗相戀三年烈疚,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片前硫。...
    茶點故事閱讀 40,435評論 1 352
  • 序言:一個原本活蹦亂跳的男人離奇死亡胞得,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情阶剑,我是刑警寧澤跃巡,帶...
    沈念sama閱讀 36,126評論 5 349
  • 正文 年R本政府宣布,位于F島的核電站牧愁,受9級特大地震影響素邪,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜猪半,卻給世界環(huán)境...
    茶點故事閱讀 41,804評論 3 333
  • 文/蒙蒙 一兔朦、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧磨确,春花似錦沽甥、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,276評論 0 23
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至邓了,卻和暖如春恨诱,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背骗炉。 一陣腳步聲響...
    開封第一講書人閱讀 33,393評論 1 272
  • 我被黑心中介騙來泰國打工照宝, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人句葵。 一個月前我還...
    沈念sama閱讀 48,818評論 3 376
  • 正文 我出身青樓厕鹃,卻偏偏與公主長得像,于是被迫代替她去往敵國和親笼呆。 傳聞我的和親對象是個殘疾皇子熊响,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 45,442評論 2 359

推薦閱讀更多精彩內(nèi)容

  • A.我今天學(xué)到了什么 一.margin的一點小問題 1.給子元素margin-top:父元素移動,子元素不移動 解...
    孔子曰_f425閱讀 164評論 0 0
  • 1、margin的一些小問題 1.1給子元素設(shè)置margin-top:父元素移動诗赌,子元素不移動 2種解決方式 例子...
    陳夢晴閱讀 235評論 1 0
  • 今天學(xué)了什么 1.margin的BUG MARGIN -(TOP/ BOTTOM)的 bug 2讀取路徑 絕對...
    喑啞先生閱讀 321評論 0 0
  • 今天學(xué)了什么 1.margin的一點小問題 2.絕對路徑和相對路徑 3.HTML表單相關(guān)元素 4單選框 5復(fù)合選框...
    a5033edd03f9閱讀 232評論 0 0
  • 安裝Django ubuntu系統(tǒng): 安裝pip 安裝django 源碼安裝: https://www.djang...
    夢想做小猿閱讀 111評論 0 0