1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

HTML <div>組みからの脱却 〜ファーストステップ〜

Last updated at Posted at 2019-08-09

「まずはdivタグどんどん使っていいからhtml作ってみよう」

今の会社に入った時、DOMってなんぞや?ぐらいの知識しかなかったので、
とりあえず仕事ができるように、そう言われて何の違和感もなく、DIV組みしてきました。

webシステムってSEO一切関係ないから、崩れなければそれでよし。
そこがいちばんのポイントだから、DOMの構造や、
そのほかのタグなんてものは、勉強しなかったわけですよ。

<img>タグはbackgroundで代用できるし、
<list><dt>とかも使わなくても<div>だけで組めちゃう。
流石に<table>とかは使っちゃいますけど。

でもでもでも。

なんかちょっと最近、divでhtml組んでることが恥ずかしくなってきました。
webデザインとかフロントかじってます。って言っときながら。
div組みかよ。って。

そこで「脱div組み」を目指すことにしました!
いろんなサイト見てみたけど、当面はとりあえず以下を意識。

wraper系の、枠組みとかレイアウトに関わるものは<div>でOK。
ヘッダーは<header>
メニューは<nav>
コンテンツ(内容)部分は<main>
フッターは<footer>

タイトルは<h1><h5>
テキストは<p>
イメージは<img>、だけど場合によってはcssのbackgroundでいい。

表は<table>
リストは<ul>

とりあえずこんな感じのマークアップから始めてみる。

とかとか興味あるものは、 その次のステップってことで。

これも意識した方がいいっていうのがあれば、
ぜひコメントください。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?