10MINs首頁(yè)

這篇文章先講幾個(gè)重要的點(diǎn),然后文末有效果圖和具體代碼

  • css優(yōu)先級(jí)

<div class="column">
            <div class="ui inverted segment card-view" style="background: url('img/card.png');background-size: cover;background-repeat: no-repeat;">
            <h3 class="ui header">Title's here</h3>
            <h4 class="ui header">Username</h4>
            <div class="ui divider"></div>
            <div class="ui red circular label">40%get</div>
            <span>10k<i class="icon unhide"></i></span>
        </div>
        </div>

這里再介紹一種選擇器,之前我們?cè)谛薷臅r(shí),為了防止修改一個(gè)標(biāo)簽而造成其他標(biāo)簽樣式的改變,我們會(huì)給標(biāo)簽加一個(gè)別名,此外,我們也可以使用子孫選擇器

.ui.vertical.basic.segment.recommended > .ui.center.aligned.header{
    
}

今天發(fā)現(xiàn)一個(gè)問(wèn)題,就是css選擇器不要留空格,比如以下這種方式是不對(duì)的

.ui .vertical .basic .segment .recommended{

}

需要改成無(wú)空格:

.ui.vertical.basic.segment.recommended{

}
  • 柵格布局

1.定距

<div class="ui three column grid">
        <div class="column">
                </div>
        <div class="column">
                </div>
        <div class="column">
                </div>

</div>

2.定寬

<div class="ui grid">
        <div class="four wide column">
                </div>
        <div class="four wide column">
                </div>
        <div class="four wide column">
                </div>
        <div class="four wide column">
                </div>
</div>

效果圖

完整HTML代碼

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="css/semantic.css">
    <link rel="stylesheet" href="10Mins.css">
</head>
<body>
    <div class="ui vertical basic segment master">
        <div class="ui  text menu">
            <div class="ui image logo">
                ![](img/word.png)
            </div>
            <div class="right menu">
                <div class="item">
                    <button type="button" name="button" class="ui inverted circular blue button">Login</button>
            </div>
        </div>
    </div>
    <h1 class="ui center inverted aligned header slogan">
            這里是大標(biāo)題應(yīng)該出現(xiàn)的位置
        <p class="sub header">
        這里是子標(biāo)題出現(xiàn)的位置
        </p>
        <button type="button" name="button" class="ui  circular red button">注冊(cè)一個(gè)</button>
    </h1>
        
    </div>

    
<div class="ui vertical basic segment recommended">
            <h1 class="ui center aligned header">10mins學(xué)會(huì)一門(mén)技能</h1>
    <div class="ui three column grid container">
        <div class="column">
            <!-- style="background: url('img/card.png');background-size: cover;background-repeat: no-repeat;" -->
            <div class="ui inverted segment card-view" >
            <h3 class="ui header">Title's here</h3>
            <h4 class="ui header">Username</h4>
            <div class="ui divider"></div>
            <div class="ui red circular label">40%get</div>
            <span>10k<i class="icon unhide"></i></span>
        </div>
        </div>
        <div class="column">
            <div class="ui inverted segment card-view">
            <h3 class="ui header">Title's here</h3>
            <h4 class="ui header">Username</h4>
            <div class="ui divider"></div>
            <div class="ui red circular label">40%get</div>
            <span>10k<i class="icon unhide"></i></span>
        </div>
        </div>
        <div class="column">
            <div class="ui inverted segment card-view">
            <h3 class="ui header">Title's here</h3>
            <h4 class="ui header">Username</h4>
            <div class="ui divider"></div>
            <div class="ui red circular label">40%get</div>
            <span>10k<i class="icon unhide"></i></span>
        </div>
        </div>
        <div class="column">
            <div class="ui inverted segment card-view">
            <h3 class="ui header">Title's here</h3>
            <h4 class="ui header">Username</h4>
            <div class="ui divider"></div>
            <div class="ui red circular label">40%get</div>
            <span>10k<i class="icon unhide"></i></span>
        </div>
        </div>
        <div class="column">
            <div class="ui inverted segment card-view">
            <h3 class="ui header">Title's here</h3>
            <h4 class="ui header">Username</h4>
            <div class="ui divider"></div>
            <div class="ui red circular label">40%get</div>
            <span>10k<i class="icon unhide"></i></span>
        </div>
        </div>
        <div class="column">
            <div class="ui inverted segment card-view">
            <h3 class="ui header">Title's here</h3>
            <h4 class="ui header">Username</h4>
            <div class="ui divider"></div>
            <div class="ui red circular label">40%get</div>
            <span>10k<i class="icon unhide"></i></span>
        </div>
        </div>
    </div>
</div>

<div class="ui pink inverted basic segment people-say">
    <h3 class="ui center aligned header">呈現(xiàn)給您最簡(jiǎn)潔有趣的知識(shí)是我們認(rèn)為最有趣的事情</h3>
    <div class="ui grid">

        <div class="four wide column">
            <div class="ui circular segment">
                <i class="icon red inverted circular star "></i>
                <h4 class="ui inverted header">首席執(zhí)行官
                <p class="sub header">CEO</p></h4>
            </div>
        </div>
        <div class="four wide column">
            <div class="ui circular segment">
                <i class="icon red inverted circular star "></i>
                <h4 class="ui inverted header">首席執(zhí)行官
                <p class="sub header">CEO</p></h4>
            </div>
        </div>
        <div class="four wide column">
            <div class="ui circular segment">
                <i class="icon red inverted circular star "></i>
                <h4 class="ui inverted header">首席執(zhí)行官
                <p class="sub header">CEO</p></h4>
            </div>
        </div>
        <div class="four wide column">
            <div class="ui circular segment">
                <i class="icon red inverted circular star "></i>
                <h4 class="ui inverted header">首席執(zhí)行官
                <p class="sub header">CEO</p></h4>
            </div>
        </div>

    </div>
    <button name="button" type="button" class="ui red inverted circular button">Be our coach</button>
</div>

<div class="ui inverted vertical padded segment">
    <div class="ui grid">
        <div class=" four wide column">
            <div class="ui inverted vertical padded text menu">
                <div class="ui image">
                    ![](img/panda.png)
                </div>
            </div>  
        </div>
        <div class=" four wide column">
            <div class="ui inverted vertical padded text menu">
                <div class="item">Adress:CN</div>
                <div class="item">Tel:10000000</div>
                <div class="item">E-mail:1231231</div>
            </div>  
        </div>
        <div class=" four wide column">
            <div class="ui inverted vertical padded text menu">
                <div class="item">Adress:CN</div>
                <div class="item">Tel:10000000</div>
                <div class="item">E-mail:1231231</div>
            </div>  
        </div>
        <div class=" four wide column">
            <div class="ui inverted vertical padded text menu">
                <div class="item">Designed by</div>
                <div class="item">
                <h1 class="ui inverted header bottom-logo">zmy</h1>
                </div>
            </div>  
        </div>
    </div>
</div>


</body>
</html>

完整CSS代碼

.ui.vertical.basic.segment.master{
    height: 500px;
    background: url('img/hugue.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    padding-top: 40px;
}
.ui .text.menu{
    margin-top: -10px;

}
.ui.image.logo{
    margin-left: 15px;
    /* margin-top: 5px; */
    height: 50px;
    width: 50px;
}
.ui.image.footer{
    margin-left: 30px;
    margin-top: 20px;
}

.ui.inverted.circular.blue.button{
    margin-right: 20px;
    /* margin-top: -10px; */
}
.ui.center.inverted.aligned.header.slogan{
    font-size: 40px;
    position: absolute;
    transform: translate(-50%, -50%);
    left: 50%;
    top: 50%;
}
h1.ui.header .sub.header{
    margin: 20px;
}
.ui .circular.red.button{
    width: 200px;
}
.ui.inverted.header.bottom-logo{
    margin: 0px;
}
.ui.inverted.segment.card-view{
    height: 220px;
    /* background: :url('img/card.png');background-size: cover;background-repeat: no-repeat; */
}
.ui.vertical.basic.segment.recommended > .ui.center.aligned.header{
    font-size: 40px;
    margin-top: 50px;
    margin-bottom: 50px;
}
.ui.inverted.segment.card-view > .ui.header{
    margin-bottom: 50px;
}
.ui.pink.inverted.basic.segment.people-say{
    height: 450px;
    /* background: url('image/people1.jpg');
    background-size: cover;
    background-repeat: no-repeat; */
}
.ui.pink.inverted.basic.segment.people-say > .ui.center.aligned.header{
    margin-top: 30px;
}
.ui.circular.segment{
    background: url('img/people2.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    width: 120px;
    height: 120px;
    position: absolute;
    left: 50%;
    top: 200px;
    transform: translate(-50%, -50%);
}
.ui.circular.segment > .ui.header{
    position: absolute;
    left: 50%;
    top: 110%;
    transform: translate(-50%, -50%);
    width: 200px;
}
.icon.red.inverted.circular.star{
    position: absolute;
    left: 100%;
    top: 100%;
    transform: translate(-100%, -100%)
}
.ui.pink.inverted.basic.segment.people-say > .ui.red.inverted.circular.button{
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, -50%);
    background: white;
}
.ui.inverted.vertical.padded.segment{
    margin-top: 100px;
}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末蛛倦,一起剝皮案震驚了整個(gè)濱河市尸执,隨后出現(xiàn)的幾起案子伐蒂,更是在濱河造成了極大的恐慌扣囊,老刑警劉巖秃臣,帶你破解...
    沈念sama閱讀 221,635評(píng)論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件沸枯,死亡現(xiàn)場(chǎng)離奇詭異肤视,居然都是意外死亡,警方通過(guò)查閱死者的電腦和手機(jī)字柠,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,543評(píng)論 3 399
  • 文/潘曉璐 我一進(jìn)店門(mén)探越,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái),“玉大人窑业,你說(shuō)我怎么就攤上這事钦幔。” “怎么了常柄?”我有些...
    開(kāi)封第一講書(shū)人閱讀 168,083評(píng)論 0 360
  • 文/不壞的土叔 我叫張陵鲤氢,是天一觀的道長(zhǎng)。 經(jīng)常有香客問(wèn)我西潘,道長(zhǎng)卷玉,這世上最難降的妖魔是什么? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 59,640評(píng)論 1 296
  • 正文 為了忘掉前任秸架,我火速辦了婚禮揍庄,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘东抹。我一直安慰自己,他們只是感情好沃测,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,640評(píng)論 6 397
  • 文/花漫 我一把揭開(kāi)白布缭黔。 她就那樣靜靜地躺著,像睡著了一般蒂破。 火紅的嫁衣襯著肌膚如雪馏谨。 梳的紋絲不亂的頭發(fā)上,一...
    開(kāi)封第一講書(shū)人閱讀 52,262評(píng)論 1 308
  • 那天附迷,我揣著相機(jī)與錄音惧互,去河邊找鬼。 笑死喇伯,一個(gè)胖子當(dāng)著我的面吹牛喊儡,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播稻据,決...
    沈念sama閱讀 40,833評(píng)論 3 421
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼艾猜,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了?” 一聲冷哼從身側(cè)響起匆赃,我...
    開(kāi)封第一講書(shū)人閱讀 39,736評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤淤毛,失蹤者是張志新(化名)和其女友劉穎,沒(méi)想到半個(gè)月后算柳,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體低淡,經(jīng)...
    沈念sama閱讀 46,280評(píng)論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,369評(píng)論 3 340
  • 正文 我和宋清朗相戀三年瞬项,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了蔗蹋。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 40,503評(píng)論 1 352
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡滥壕,死狀恐怖纸颜,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情绎橘,我是刑警寧澤胁孙,帶...
    沈念sama閱讀 36,185評(píng)論 5 350
  • 正文 年R本政府宣布,位于F島的核電站称鳞,受9級(jí)特大地震影響涮较,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜冈止,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,870評(píng)論 3 333
  • 文/蒙蒙 一狂票、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧熙暴,春花似錦闺属、人聲如沸。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 32,340評(píng)論 0 24
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至俱箱,卻和暖如春国瓮,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背狞谱。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 33,460評(píng)論 1 272
  • 我被黑心中介騙來(lái)泰國(guó)打工乃摹, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人跟衅。 一個(gè)月前我還...
    沈念sama閱讀 48,909評(píng)論 3 376
  • 正文 我出身青樓孵睬,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親与斤。 傳聞我的和親對(duì)象是個(gè)殘疾皇子肪康,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,512評(píng)論 2 359

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

  • 問(wèn)答題47 /72 常見(jiàn)瀏覽器兼容性問(wèn)題與解決方案荚恶? 參考答案 (1)瀏覽器兼容問(wèn)題一:不同瀏覽器的標(biāo)簽?zāi)J(rèn)的外補(bǔ)...
    _Yfling閱讀 13,759評(píng)論 1 92
  • Android 自定義View的各種姿勢(shì)1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 172,283評(píng)論 25 707
  • 嘿谒撼!楚卿,這是一家青年旅舍的店名雾狈。位于北戴河廓潜,劉莊育花區(qū)6排2號(hào)。 9月19號(hào)的時(shí)候善榛,我在空間發(fā)了一條動(dòng)...
    丁走心閱讀 385評(píng)論 0 2
  • 作者:喵小萌 每一張照片都是時(shí)間的標(biāo)本辩蛋,是無(wú)聲的電影,那些曾經(jīng)觸動(dòng)你內(nèi)心的瞬間在鏡頭中定格成永恒移盆! 我不知道大家是...
    若思蘭馨閱讀 688評(píng)論 0 1
  • 心如止水的生活咒循, 是你由來(lái)已久的向往据途。 你日復(fù)一日地, 日復(fù)一日地把自己的心叙甸, 修煉…… 心的修為足夠了颖医, 那向往...
    小劇在成長(zhǎng)閱讀 161評(píng)論 0 1