SlideShare a Scribd company logo
1 of 32
ウェブサイトの作り方
実践日記-1
1.ウェブサイトを見る流れ
見る人がサイトに入る
見る人が知りたいものがあって
googleなどで検索する
検索結果を見てサイトを選ぶ
お客さんが商品を探す
お客さんが店を見渡す
見たい商品を
クリックする
1.ウェブサイトを見る流れ
お客さんが商品を見る
1.ウェブサイトを見る流れ
2.「1」の裏で動くブラウザの流れ
見る人がサイトに入る
お客さんが店のドアを開ける
サイトを見せている地図や建物
=店の引っ越し屋さん、店舗スタッフ
→パソコンでは、これらの人たちに指示するのが「ブラウザ」
引っ越し屋さんが「店はここ
だよ」って検索結果(地図)
に目印を描く
見る人 見せている人=ブラウザ
☝
お客さんが店を見渡す
引っ越し屋さん(ブラウザ)に商品
をここにおいてくださいという設計
所を元に店を作って商品を置く
お客さんが店のドアを開ける
この設計書をブラウザに分か
りやすいようにした言葉
⇒html、css、
Javascript
実際の店はそこ
に出来上がっている
ウェブサイトはドアを
開けるたびにブラウザ
が素早く店を作る
設計書の役割
• 店のレイアウト(棚の位置)をパソコンに伝える言葉=html
例えば…タイトルや記事の内容、検索ボタン
• 店の中身(棚の大きさ、位置)を飾るルール=css
例えば…文字の大きさや位置、色など
• 店での中身を動かしたりするルール=Javascript
例えば…服を試着する、買う
これら三つを一つのファイル(~.html)
にまとめると設計書が出来上がる
後から修正しやすいサイトの設計方法
• 店のレイアウトや中身、仕掛けなど大部分を
htmlで設計できなくもない。
• でも、そうすると、一枚の設計書が数千行と
なってわけがわからなくなってしまう。
htmlファイルに
Cssファイル、
JavaScriptファイル
をリンク付けしたほ
うが修正しやすい
棚の位置や色を伝える
Cssファイル(~.css)
棚の開閉や服の試着などの仕掛け
を伝えるJavaScriptファイル(~.js)
パソコンに伝える店の設計
書をまとめたhtmlファイル
(htmlだけで書ける部分+ほかのファイル
で指示された仕掛け)
Htmlの設計ルール
• Htmlを描くには高価なソフトは必要ない。
• メモ帳(Windows)やテキストエディット(Mac)に書いて、
「~.html」で保存すれば設計書はできる。
• しかし、専用の編集ソフト(テキストエディタ)を使うと、間
違った書き方をしたときに教えてくれるのでそれを使ったほう
が良い。⇒AtomやVsCodeなど
・ファイル(設計書)の名前の最後を
「.html」と書くことで、これが設計書だよと
パソコンに教えることができる。
Htmlの設計ルール①
• htmlは上から書く。⇒サイトを見る人は書いた順に見られる。
• レイアウトの中でも、表札や玄関、棚やレジですよ。と伝える
ものがタグという。表札なら「title」など。
• タグは<title>と、タグ名の前後に<>をつける。
• このタグの中身を書き終えると、</title>と/を加えてこれでタ
イトルは書き終えましたよと伝える。
• そうすると、ブラウザは次のタグを探そうと次の作業(店の表
札を作ったら、次は玄関を作る)に移るために、下の行に進む。
htmlの設計ルール②
• 最低限必要なタグと配置の説明
• 設計書の1行目には、<!DOCTYPE html>と書く。
• 設計書の最後の行には</html>と書く。
• 2行目には、サイトに表示する言語を指定する⇒
日本語なら、<html lang=“ja”>
• 3行目には、検索結果に表示される <head></head>を書く。
htmlの設計ルール③ <head>の説明
• サイトを日本語で書けるようにパソコンに指示するために<meta
charset=“UTF-8”>と書く。文字化けしないようにする
• metaと書くのはメタタグと呼ばれる。
• ⇒文字化け防止や、検索結果に引っかかるようなキーワード、サイ
トをスマホでも画面いっぱいに表示できるように指示するタグ。サ
イトには見えない。
• <head>メタタグやタイトルタグ</head>とする。
• タグの中にタグをまとめる方法👇
• まとめるタグの下の行に、まとめるタグの半角2つを空けてタグを
書く。
• タグはたくさんあるので、ここでは最低必要(私が使っているもの
など)なものを紹介する。
htmlの設計ルール④
• 最低限必要なタグと配置の説明
• </head>で閉じた後、下の行で、いよいよ見られるサイト(店
に入ってからの中身)を書く。
• 見られるサイトであると指示するタグはbodyタグ。
• <body>見られる中身(後で説明)</body>と書く。
• </body>で閉じた後、下の行に</html>と書く。
• これでパソコンに、「これで設計書は終わりです。」と伝える。
htmlの設計ルール④ <body>の中身
• 見出しのタグ→<h1></h1>
• 文章のタグ→<p></p>
• 改行のタグ→<br>
• 区切り線のタグ→<hr>
• 画像を挿入するタグ→<img></img>
• リスト表示するタグ
→<ul><li></li></ul>・・・ulでこれから●でリスト化すると
言って、liで中身を書く
→<ol><li></li></ol>・・・ulでこれから数字でリスト化する
と言って、liで中身を書く
htmlの設計ルール④ <body>の中身
• ヘッダー(一番上に見せたいもの)のタグ
→<header></header>
• フッター(一番下に見せたいもの)のタグ
→<footer></footer>
• メインとなる内容を見せるタグ→<main></main>
htmlの設計ルール④ <body>の中身
• 一つにまとめたいものがあるときに使うタグ→<div></div>
• 一つにまとめるとは?
• 例①一つの記事や内容(会社概要など)毎に文字の色を変えた
いなど(会社概要の見出し(<h>)や文章(<p>)など)
• 例②横並びにしたいものがある。
まとめたものとパソコンに伝えるために…
<div>
<label class ="btn btn-primary btn-xs avtive" id="checkbox">
<input type="checkbox">
<font size="4px">車いす対応</font>
</label>
<label class ="btn btn-primary btn-xs avtive" id="checkbox">
<input type="checkbox" >
<font size="4px">乳幼児用</font>
</label>
<label class ="btn btn-primary btn-xs avtive" id="checkbox">
<input type="checkbox">
<font size="4px">オストメイト</font>
</label>
<label class ="btn btn-primary btn-xs avtive" id="checkbox">
<input type="checkbox">
<font size="4px">多目的トイレ※</font>
</label>
</div>
半角2つ
半角2つ
htmlで作られた店のレイアウト
店の名前
(<title>)
店のドア
<head>
ジャケット
(<h>,<p>)
アウター
(<h>,<p>)
ガーディガン
インナーフロア
半そでシャツ 長袖シャツ
棚の縦の間
隔(<br>)
インナーフロア
との境界線
(<hr>)
インナー
(<div>)
<div>
<h>
<p>
<hr>
<br>
2.CSSの設計ルール
• CSSとは…ページの背景色や文字の大きさ、フォントや色、
<div>の位置などをパソコンに伝える設計書
• htmlが引っ越しでおおよその位置(店から入って最初にアウ
ターのコーナー、その先にインナーコーナーがあって横並びに
カーディガンなどを置く)を決める。
• CSSでは、おおよその位置に置いた商品や棚などの位置を微調
整したり、アピールできるように装飾する。
CSSの設計ルール
• 設計書となるファイル名の最後を「~.css」とする。
• まず、色や位置を決めたいもの(htmlのタグ)を指定する。
• この指定したhtmlのタグをCSSではセレクターという。
• タグを書いた後に、色や位置を{}で閉じる。
• 例えば、サイト全体(bodyタグ)の色を薄ピンク色にしたいとき。
body {
background-color: MISTYROSE;
}
プロパティ:
Bodyのどこを変えたいか
(ここでは背景色)
値:
プロパティをどう変えたいか
(ここでは薄ピンク色)
1つ変えたら、
必ず;で終える。
セレクター
• htmlのタグが一つのファイルに一個だけの場合、
→そのまま、タグの名前を指定。
でも…
• 二個以上あったり、この文章の色を変えたい!という場合は?
→このタグだけ違うよ!という名前を付ける。
方法1・・・classを入れる。
<p class = “this”>この文章</p>
方法2・・・idを入れる。
<p id = “this”>この文章</p>
CSSの設計ルール
index.html style.css
p.this { color : “red”}
p#this { color : “red”}
.でタグと名前
をつなげる
#でタグと名前をつなげる
英数字、ー、_で書く
CSSの設計ルール
• class = 種類の名前…1組、2組...というグループ分け
• id = 固有の名前…たかしくん、はなこさん...人の名前分け
ファイル(html,css,js)1つに対して何回も使える→class
1回しか使えない→id
classとidはどういうときに使い分ける?
CSSの設計ルール~classの使い方~
• 見出し(h1タグ)と文章(pタグ)をまとめて赤文字にしたいとき
→見出しのidと文章のidをそれぞれ違う名前をつけると面倒。
• divタグを使ってまとめてclassタグで指定すればcssで一行で済む
例
<div class = “this”>
<h1>紹介</h1>
<p>これはりんごです</p>
</div>
index.html style.css
div.this { color : “red”}
thisというクラスの中にあるh1とpタグに囲まれた文字が赤文字になる
まとめて変えたいもの(h1,p)を
まとめてくれるタグ(div)の下に
半角2文字空けて書く
CSSの設計ルール~いろんなプロパティ
• 文字の大きさ→font-size: 0.9em;
• 文字を太くする→font-weight: bold;
• 背景色→background-color: blue;
• 文字などを見えなくする→display: none;
• 記事などの配置→幅:width: 400px;
• 記事などの配置→高さ:height: 400px;
• 記事などの配置→下の文章との余白:bottom: 400px;
• 記事などの配置→文章を中央にする:text-align: center;
ほかにもたくさんあるので、調べてみてください。
<div class =
“this”>
</div>
<div class =
“next”>
</div>
width
height
bottom
htmlにCSSを伝える。
• html→店の中身(アウターやインナー、ジャケットなど)とそ
のだいたいの配置
=ドアから入ってアウターの奥にTシャツ
• css→店の中身の最終的な配置と飾り付け
=アウターを目立たせるために看板を大きくしたり、人が入れる
ように通路の幅を決める。
htmlファイルがパソコン(引っ越し屋さん)に伝える指示書
↓
htmlファイルの中にcssファイルをつなげる。
htmlにCSSを伝える。
• 方法①…cssファイルでまとめるほど飾らないとき
styleタグを使って、htmlファイルの中に直接書き込む。
<head>
~省略~
<style>
body { background-color: mistyrose; }
</style>
<head>
<body>
・・・
headタグの中に書く!!
htmlにCSSを伝える。
• 方法②…cssファイルでまとめて指定したいとき
linkタグを使って、htmlファイルとcssファイルをつなげる。
<head>
~省略~
<link rel = “stylesheet” href = “style.css”>
<head>
<body>
・・・
headタグの中に書く!!
ファイルをつなげる言葉
つなげるcssファイル
cssファイルですよとパソコンに教
える言葉
いろんなタグの調べ方
• 数えきれないくらいのタグがあるので、作りたいページを下書
きしてから、それに合いそうなサイトを探したり、辞典や質問
サイトで調べるとよいです。
①参考資料
私が使っている本
1.HTML&CSS 逆引き辞典
今すぐ使えるかんたんEx HTML&CSS 逆引き事典 | 大藤 幹 |本 |
通販 | Amazon
2.現場で使える最低限の知識がしっかりと身につく
HTML/CSSデザインTextBook
いろんなタグの調べ方
①自分の理想に合いそうなサイトから勉強する方法
・現在、大体のサイトではどういう構造でサイトが作られている
かがわかるサイトの設計書を見ることができます。
1.知りたいサイトを検索
2.右上の「・・・」を左クリック
3.「その他のツール」を左クリック
4.一番下の「開発者ツール」を左クリック
いろんなタグの調べ方
5.「ようこそ」の隣にある「要素」を左クリック
6.カーソルを合わせた
ところが、左のように
薄い青色で表示されます。
補足…いろんなタグ①
• 表を表すタグ…<table>
• 文章のある文字を<strong>で囲むと太字、<em>で囲むと斜め字
• 文章のある文字を<mark>で囲むとマーカーで引いた文字
• 別のページへ飛ばしたい(違う部屋への扉を作りたい)ときは、
<a href = “nextpage.html”>次のページへ</a>
• 画像を表示したいときは、<img src = “image.png” width=“100”
height=“100”>
• 音声を再生したいときは、<audio src = “audio.mp3”></audio>
• 動画を再生したいときは、<video src = “audio.mp4”></video >
補足…いろんなタグ②
• 入力フォームを表すタグ…<input>タグ
・文字を入力したいとき、<input type=“text”>
・チェックボックスを作りたいとき、< input type=“checkbox”>
・ラヂオボタンを作りたいとき、< input type=“radio”>
・電話番号を入力したいとき、< input type=“tel”>
ほかにも、
・送信ボタン
・CSSと組み合わせてメニュー、ボタンを押すと下に細かいメ
ニューが伸びるアコーディオンと呼ばれるメニューも作れます。

More Related Content

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Featured (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

ウェブサイトの作り方