Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
第05回Web講座資料
Search
北海道科学大学 電子計算機研究部
June 14, 2017
Programming
0
75
第05回Web講座資料
背景
北海道科学大学 電子計算機研究部
June 14, 2017
Tweet
Share
More Decks by 北海道科学大学 電子計算機研究部
See All by 北海道科学大学 電子計算機研究部
第12回Network講座2019
densan
1
40
第11回Network講座2019
densan
0
65
第10回Network講座2019
densan
0
34
第09回Network講座2019
densan
1
130
第08回Network講座2019
densan
0
41
第07回Network講座2019
densan
0
41
第06回Network講座2019
densan
0
50
第05回Network講座2019
densan
0
41
第04回Network講座2019
densan
0
64
Other Decks in Programming
See All in Programming
Docker_OSS_ホスティング入門
satokoki645
0
140
GoでParserを書く
karupanerura
3
310
Escolhendo (ou não) o melhor ORM para o seu projeto
andreiacsilva
1
160
Introducing Kotlin Multiplatform in an existing mobile app - Workshop Edition | AndroidMakers Paris
prof18
0
180
Fragment Composition of GraphQL
quramy
14
1.7k
教えて!スクラムコーチ品質とスピードのバランスはどうすりゃいいの?
pinboro
0
110
哲学史とモデリング
tanakahisateru
2
420
戦略的DDDは重いのか? / Is strategic DDD heavy?
pictiny
3
2.1k
Three ways to use AI on Android: The Good, the Bad and the Ugly
marxallski
0
120
Balkan Ruby 2024 — How and why to run SQLite on Rails in production
fractaledmind
0
110
TypeScriptとGraphQLで実現する 型安全なAPI実装 / TSKaigi 2024
hokaccha
5
2.7k
『WordPressコミュニティで学ぶ』OSS貢献の多様性
ippey
0
230
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
Atom: Resistance is Futile
akmur
260
25k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
20
1.8k
Gamification - CAS2011
davidbonilla
77
4.6k
Producing Creativity
orderedlist
PRO
338
39k
jQuery: Nuts, Bolts and Bling
dougneiner
60
7.2k
Teambox: Starting and Learning
jrom
128
8.4k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
How GitHub (no longer) Works
holman
305
140k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Transcript
第5回 Web講座
概要 背景関連のプロパティ CSSの背景に関するプロパティを学ぶ。 背景色の指定や、背景画像の表示方法を自由に設定できるよ うになる。 練習課題 時間があれば取り組んでください。
前準備 1. 適当な画像を用意(背景に使用します)。 2. background.html background.cssを作成。 3. background.htmlをエディタで開き、 !→Tabキー でHTMLの雛形を挿入。
4. <head>タグ内に<link>タグを挿入(link→Tabキー)。 5. hrefでbackground.cssの場所を指定。 例: <link rel="stylesheet" href="./css/background.css"> 以降は主にbackground.cssを編集します。 背景は<p>や<div>などの要素にも指定できますが、本講座では主に<body>に使います。
背景に関するプロパティ background-color … 背景色の指定 background-image … 背景画像の指定
background-position … 背景画像の表示開始位置の指定 background-repeat … 背景画像のリピートの仕方を指定する background-attachment … 背景画像の固定を行う background-size … 背景画像のサイズの指定する
background-color 要素の背景色を指定する。色の指定方法は前回紹介した通り。 background-color: #ff0000; background-color: #f00; background-color: rgb(255,0,0); background-color: rgba(100%,0%,0%,40%);
background-image 要素の背景画像を設定する。 background-image: url(画像のパス); と指定する。 background-image: url(“../img/sample.png”);
background-position 背景画像の表示位置を指定する。 background-position: 水平方向の位置 垂直方向の位置; と指定する background-position: center top;
background-position 水平方向の位置の指定 1. left 2. center 3. right 4.
数値(px)で指定 5. %で指定 ◦ 垂直方向の位置の指定 1. top 2. center 3. bottom 4. 数値(px)で指定 5. %で指定
background-position 横400×縦300
background-position background-positon: left top;
background-position background-positon: center bottom;
background-position background-positon: 100px 200px; 200px 100px
background-repeat 指定方法 1. repeat ・・・ 敷き詰める(初期値) 2. repeat-x ・・・
水平方向に並べる 3. repeat-y ・・・ 垂直方向に並べる 4. no-repeat ・・・ 一つだけ表示
background-repeat background-repeat: repeat; (指定なしと同様)
background-repeat background-repeat: repeat-x;
background-repeat background-repeat: repeat-y;
background-repeat background-repeat: no-repeat;
background-attachment 指定方法 1. scroll ・・・ 要素に対して固定される(初期値) 2. fixed ・・・
画面に対して固定される 3. local ・・・ 要素の内容に対して固定される ※詳しくはattachment.html attachment.cssを参照してください。
background-size 背景画像のサイズを指定する。 background-size: 幅 高さ; で指定、あるいは ~ contain;等属性値で指定する。 auto:
初期値。元画像からのアスペクト比を変えずに表示 contain: 背景領域に収まる最大サイズで表示する cover: 背景領域を完全に覆うサイズで表示する 数値で指定 %で指定
background-size
課題 以下のようなWebページを制作してください。 大見出し:ネットワークチーム 小見出し:活動 本文 :サーバの保守(改行)管理(改行)Web更新 小見出し:活動日 本文 :木曜日
画像を背景に設定し、一枚の画像を、背景領域を完全に覆うサイズで表示してください。 本文の部分にはパターン画像を敷き詰めてください。
課題表示例
おしまい 次回は続けてCSSのプロパティです