最近面試前端面試題整理(css部分)

來源:互聯網
上載者:User

標籤:bsp   pos   set   csharp   log   pre   tab   class   ble   

 對最近面試的面試題坐下總結:

一,css部分

1,html元素的垂直置中

答案:

<div id="box">     <div>      測試     </div>   </div> #box{       width: 200px;       height: 200px;      text-align:center;      vertical-align: middle;      display: table-cell;      }

 2,css考的最多是flex;

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>Document</title>    <style>    .flex {        display: flex;        width: 800px;        margin: 0;        padding: 0;        list-style: none;    }    .flex :nth-child(1) {        flex: 1 1 300px;    }    .flex :nth-child(2) {        flex: 2 2 200px;    }    .flex :nth-child(3) {        flex: 3 3 400px;    }    </style></head><body>    <ul class="flex">        <li>a</li>        <li>b</li>        <li>c</li>    </ul></body></html>

 建議多看看這塊。

3,然後css還考察了清楚浮動的方法:

答案:

clear:both; overflow:hidden;偽類;

4,就是相對定位和絕對位置相關知識點

比如:position有哪些屬性值,每種的意義和用法。

最近面試前端面試題整理(css部分)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.