久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      css如何定義網(wǎng)格線大小

      css背景方面的知識我們已經(jīng)學的差不多了,接下來我們來看一下柵格系統(tǒng)的知識。有需要的小伙伴可以參考參考。

      我們先來看一個小栗子。

       <style>       article {           display: grid;           width: 300px;           height: 300px;           grid-template-rows: repeat(3,1fr);           grid-template-columns: repeat(3,1fr);       }       div{           background: rgb(208, 159, 255);           background-clip: content-box;           border: solid 1px rgb(208, 159, 255);           padding: 10px;       }     </style>   </head>   <body>     <article>       <div>1</div>       <div>2</div>       <div>3</div>       <div>4</div>       <div>5</div>       <div>6</div>       <div>7</div>       <div>8</div>       <div>9</div>     </article>   </body>

      這個小例子的結(jié)果是

      css如何定義網(wǎng)格線大小可以看到,我們通過改了屬性的值,將原本十分漂亮的布局變成了不是特別好看的一個布局。那我們改變了什么屬性呢?通過觀察可以看到,改變了grid-template-rowsgrid-template-columns的屬性值。

      那我們來看一下這兩個屬性吧。

      grid-template-columns屬性是基于 網(wǎng)格列. 的維度,去定義網(wǎng)格線的名稱和網(wǎng)格軌道的尺寸大小。這些值是一個用空格分隔的列表,其中每個值指定相應列的尺寸。

      語法格式是

      grid-template-columns: none|auto|max-content|min-content|length|initial|inherit;

      這是這個屬性值的具體介紹。

      • none:這個關(guān)鍵字表示不明確的網(wǎng)格。所有的行和其大小都將由grid-auto-rows 屬性隱式的指定。

      • max-content:是一個用來表示以網(wǎng)格項的最大的內(nèi)容來占據(jù)網(wǎng)格軌道的關(guān)鍵字。

      • min-content:是一個用來表示以網(wǎng)格項的最大的最小內(nèi)容來占據(jù)網(wǎng)格軌道的關(guān)鍵字。

      • auto:如果該網(wǎng)格軌道為最大時,該屬性等同于 <max-content> ,為最小時,則等同于 <min-content> 。

      grid-template-columns屬性看過了之后,我們?nèi)タ戳硗庖粋€屬性grid-template-rows。

      grid-template-rows 規(guī)定網(wǎng)格布局中的行數(shù)(和高度)。值是用空格分隔的列表,其中每個值指定相應行的高度。

      再來看看這個屬性的語法格式。

      grid-template-rows: none|auto|max-content|min-content|length|initial|inherit;

      發(fā)現(xiàn)這個屬性的值和上一個屬性的值一模一樣,這樣我們就不用記那么多了。我們來看一下簡潔版本

      css如何定義網(wǎng)格線大小

      推薦學習:css視頻教程

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號