W3.CSS

W3.CSSホーム W3.CSSイントロ W3.CSSカラー W3.CSSコンテナ W3.CSSパネル W3.CSSボーダー W3.CSSカード W3.CSSのデフォルト W3.CSSフォント W3.CSS Google W3.CSSテキスト W3.CSSラウンド W3.CSSパディング W3.CSSマージン W3.CSSディスプレイ W3.CSSボタン W3.CSSノート W3.CSSの見積もり W3.CSSアラート W3.CSSテーブル W3.CSSリスト W3.CSS画像 W3.CSS入力 W3.CSSバッジ W3.CSSタグ W3.CSSアイコン W3.CSSレスポンシブ W3.CSSレイアウト W3.CSSアニメーション W3.CSS効果 W3.CSSバー W3.CSSドロップダウン W3.CSSアコーディオン W3.CSSナビゲーション W3.CSSサイドバー W3.CSSタブ W3.CSSページ付け W3.CSSプログレスバー W3.CSSスライドショー W3.CSSモーダル W3.CSSツールチップ W3.CSSグリッド W3.CSSコード W3.CSSフィルター W3.CSSトレンド W3.CSSケース W3.CSSマテリアル W3.CSS検証 W3.CSSバージョン W3.CSSモバイル

W3.CSSカラー

W3.CSSカラークラス W3.CSSカラー素材 W3.CSSカラーフラットUI W3.CSSカラーメトロUI W3.CSSカラーWin8 W3.CSSカラーiOS W3.CSSカラーファッション W3.CSSカラーライブラリ W3.CSSカラースキーム W3.CSSカラーテーマ W3.CSSカラージェネレーター

Web構築

Webイントロ Web HTML Web CSS Web JavaScript Webレイアウト Webバンド Webケータリング Webレストラン Webアーキテクト

W3.CSSの例 W3.CSSデモ W3.CSSテンプレート

参考文献

W3.CSSリファレンス W3.CSSダウンロード

W3.CSSコンテナ


これは私のヘッダーです

これは私の記事です

この記事は薄い灰色で、テキストは茶色です。この記事は薄い灰色で、テキストは茶色です。この記事は薄い灰色で、テキストは茶色です。この記事は薄い灰色で、テキストは茶色です。この記事は薄い灰色で、テキストは茶色です。

これは私のフッターです


コンテナクラス

w3-containerクラスは、任意のHTML要素に16pxの左右のパディングを追加します。

w3-containerクラスは、次のようなすべてのHTMLコンテナ要素に使用するのに最適なクラスです。

<div>、<article>、<section>、<header>、<footer>、<form>など。


コンテナは平等を提供します

w3-containerは、すべてのHTMLコンテナ要素に同等性を提供します

  • 共通マージン
  • 一般的なパディング
  • 一般的な配置
  • 一般的なフォント
  • 一般的な色

コンテナを使用するには、 w3-containerクラスを任意の要素に追加するだけです。

<div class="w3-container">
  <p>The w3-container class is an important w3.CSS class.</p>
</div>

色を追加するには、w3-カラークラスを追加するだけです。

<div class="w3-container w3-red">
  <p>London is the capital city of England.</p>
</div>


ヘッダーとフッター

w3-containerクラスは、ヘッダーのスタイル設定に使用できます。

ヘッダ

<div class="w3-container w3-teal">
  <h1>Header</h1>
</div>

<header class="w3-container w3-teal">
  <h1>Header</h1>
</header>

W3.CSSが<div>要素と<header>要素を処理する方法に違いはありません。

w3-containerクラスは、フッターのスタイル設定に使用できます。

フッター

フッター情報はここにあります

<div class="w3-container w3-teal">
  <h5>Footer</h5>
  <p>Footer information goes here</p>
</div>

<footer class="w3-container w3-teal">
  <h5>Footer</h5>
  <p>Footer information goes here</p>
</footer>

多くのWebページは、<header>および<footer>要素の代わりに<div>要素を使用します。


記事とセクション

w3-containerクラスは、<article>要素と<section>要素のスタイルを設定するために使用できます。

<div class="w3-container">
  <h2>London</h2>
  <p>London is the most populous city in the United Kingdom,
  with a metropolitan area of over 9 million inhabitants.</p>
</div>

<article class="w3-container">
  <h2>Paris</h2>
  <p>The Paris area is one of the largest population centers in Europe,
  with more than 2 million inhabitants.</p>
</article>

<section class="w3-container">
  <h2>Tokyo</h2>
  <p>Tokyo is the center of the Greater Tokyo Area,
  and the most populous metropolitan area in the world.</p>
</section>

多くのWebページでは、<article>要素と<section>要素の代わりに<div>要素を使用しています。


Webページの例

ヘッダ

車両

車は、輸送に使用される車輪付きの自家動力自動車です。この用語のほとんどの定義は、車が主に道路を走行するように設計されていることを指定しています。(ウィキペディア)

フッター

HTMLの<div>要素を使用した例

<div class="w3-container w3-red">
  <h1>Header</h1>
</div>

<img src="img_car.jpg" alt="Car" style="width:100%">

<div class="w3-container">
  <p>A car is a wheeled, self-powered motor vehicle used for transportation. Most definitions of the term specify that cars are designed to run primarily on roads. (Wikipedia)</p>
</div>

<div class="w3-container w3-red">
  <h5>Footer</h5>
</div>

HTMLセマンティック要素を使用した例

<header class="w3-container w3-teal">
  <h1>Header</h1>
</header>

<img src="img_car.jpg" alt="Car" style="width:100%">

<article class="w3-container">
  <p>A car is a wheeled, self-powered motor vehicle used for transportation. Most definitions of the term specify that cars are designed to run primarily on roads. (Wikipedia)</p>
</article>

<footer class="w3-container w3-teal">
  <h5>Footer</h5>
</footer>

コンテナパディング

The w3-container class has a default 16px left and right padding, and no top or bottom padding:

I have no top or bottom padding

Example

<div class="w3-container w3-blue">
I have no top or bottom padding.
</div>

Normally you will not have to change the default padding of a container, because paragraphs and heading provide margins that will simulate padding.

I am a Heading

I am a paragraph.

Example

<div class="w3-container w3-blue">
  <h1>I am a Heading</h1>
  <p>I am a paragraph.</p>
</div>