CSS
 Computer >> コンピューター >  >> プログラミング >> CSS

要素がCSSでまたがる列の数を設定します


要素がまたがる列の数を設定するには、column-spanプロパティを使用します。次のコードを実行して、column-spanプロパティを実装してみてください。

<!DOCTYPE html>
<html>
   <head>
      <style>
         .demo {
            column-count: 4;
            column-rule-color: maroon;
            column-rule-style: dashed;
         }
         h1 {
            column-span: all;
         }
      </style>
   </head>
   <body>
      <div class = "demo">
         <h1>This is our heading.</h1>
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text. This is demo text.
      </div>
   </body>
</html>

  1. CSSを使用して要素の最小幅と最大幅を設定します

    要素の最小幅と最大幅を設定するには、次のコードを実行してみてください 例 <!DOCTYPE html> <html>    <head>       <style>          div {             max-width: 300px;             min-width: 100px;  

  2. CSSでhr要素のスタイルを設定するにはどうすればよいですか?

    CSSを使用してhr要素のスタイルを設定するには、コードは次のとおりです- 例 <!DOCTYPE html> <html> <meta name="viewport" content="width=device-width, initial-scale=1"> <head> <style>    body{       font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-