HTMLの基礎の基礎06

作成日:

簡単なHTMLを書き、実際に無料サーバーにアップロードして、ホームページを作るまでをやりましょう。

実際にやってみることで、本当の基礎の基礎、HTMLの規則が実体験として理解できます。


【27】margin(マージン)、padding(パディング)とは。

margin

padding

本文

text

text

text

text




【28】分割レイアウトを作る。

MAIN

text

text

text


.middle_block {
	 display: flex;
}
.side_block {
	flex: 1;
	background-color: #eee;
	margin-right: 1em;
}
.main_block {
	flex: 3;
	background-color: #eee;
}



【29】分割レイアウトパターン例01

TOP : flex01

MAIN

text

text

text

BOTTOM

URL


.top_block {
	background-color: #eee;
	margin-bottom: 1em;
}
.bottom_block {
	background-color: #eee;
	margin-top: 1em;
}

/* flex01 */

.middle_block {
	 display: flex;
}
.side_block {
	flex: 1;
	background-color: #eee;
	margin-right: 1em;
}
.main_block {
	flex: 3;
	background-color: #eee;
}



【30】分割レイアウトパターン例02

TOP : flex02

MAIN

text

text

text

BOTTOM

URL


/* flex02 */

.layout_box {
	display: flex;
}
.side_box {
	flex: 1;
	background-color: #eee;
	margin-right: 1em;
}
.right_box {
	flex: 3;
}
.top_box {
	background-color: #eee;
	margin-bottom: 1em;
}
.main_box {
	background-color: #eee;
	margin-bottom: 1em;
}
.bottom_box {
	background-color: #eee;
}


【今回はここまでです】

「marginとpadding」「分割レイアウトを作る」「レイアウトパターン2種」を解説しました。

cssでflexを使用したレイアウト方法を、作例も合わせて紹介しました。

ここまで解説してきた内容で、シンプルなWebページなら完成させられるのではないでしょうか。


次回は「font-size」「top,right,bottom,left」「X(旧Twitter)用metaタグ」を解説します。

X(旧Twitter)用のmetaタグは、Twitterに投稿した時にサムネイル画像と内容の紹介が表示されます。

それが丸ごとリンクURLになっているのでクリックするとWebページが開く、というものです。

ニュースサイトやメーカーや販売店が投稿しているのをよく見かけますね。






このページをシェアする