0
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.

HTML5の書き方_3(外部CSS)

Last updated at Posted at 2018-02-14

記述方法

<link href="ディレクトリ/ファイル名.css" rel="stylesheet" type="text/css">

各種説明

1.linkタグ
記述しているhtmlファイルとcssファイルもしくは別htmlファイルを関連づける

2.rel属性
そのファイルとどういう関係であるのかを示す
上記の場合は「ファイル名.cssはスタイルシートですよ~」と示してる

3.href属性
↓に記載↓
HTML5の書き方_2(リンクの貼り方)

4.text属性
ブラウザ(クライアント)側にドキュメントタイプを伝える
※詳しいところは今のとこわからないが入れておいたほうが無難
ちなみ上記の場合だと「cssは人間が理解できる記述だよ~」ということらしい

5.aタグとの違い
linkタグは内部的なもの(headタグ内に記載)
aタグは見せるもの(bodyタグ内に記載)

6.記述場所
<head></head>の中に記述する

注意点

・属性の順番はなんでもよい
・ディレクトリは記述するhtmlファイル上から記述

感想

text属性は意味わからんな
今度調べよう

0
0
1

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
0
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?