Web Development Course (HTML + CSS)
Web Development Course (HTML + CSS)
What is HTML?
What Does HTML Stand For?
HTML
Hypertext
TEXT
What Is HTML?
<h1> <h1>
< div> H e l l o World!</ h 1 > < div> H e l l o World!< / d i v >
</ div> </ h 1 >
✔
Technologies That Drive The Web
NEXT :
A Bit Of Relevant History Of The HTML Standard
In this lecture, we will discuss…
History of HTML
How We Got to HTML5
Web Hypertext Application
Technology Group
Not driven XHTML 1.0 WHATWG: HTML5
by Standards HTML
WHATWG
HTML5 HTML
(standard) (evolving)
In this lecture, we will discuss…
Anatomy of an
HTML Tag
Anatomy of an HTML tag
content
Element name
<p> </p>
Opening tag Closing tag
Anatomy of an HTML tag
Line Break Horizontal
HorizontalBreak
Rule
<br> <hr>
Only opening tag Only opening tag
Anatomy of an HTML tag
No space allowed Must have space No space allowed
<p id="myId"></p>
Attribute Attribute
name value
Anatomy of an HTML tag
Value in quotes
Inner single
quotes
Anatomy of an HTML tag
<p/> <p></p>
✘ ✔
Summary
Anatomy of an HTML tag
• Opening and closing tag
• Attributes
• Using double and single quotes
• How to specify tag without any content
NEXT:
Basic HTML Document Structure
In this lecture, we will discuss…
Basic HTML
Document Structure
Hands-on Time: Lecture 4
Summary
The bare minimum HTML document
HTML version declaration
Our first HTML tags!
• <html> – <meta> – <head> – < t i t l e > – <body>
Sequential (top to bottom) rendering
NEXT:
HTML Content Models
In this lecture, we will discuss…
HTML
Content Models
Block-Level Elements Inline Elements
Render to begin on a new line Render on the same line
(by default) (by default)
May contain inline or other May only contain other inline
block-level elements elements
Roughly Flow Content Roughly Phrasing Content
(HTML5 category) (HTML5 category)
NEXT:
Headings & Some New Semantic Elements
In this lecture, we will discuss…
Heading Elements
(and some new
HTML5 semantic
elements)
se·man·tic
Relating to meaning in language or logic
semantic html element
Element that implies some meaning to
the content
Human and/or machine can understand meaning of
content surrounded by a semantic element better
May help search engine ranking, i.e., SEO
Hands-on Time: Lecture 6
Summary
Well chosen content of H1 element is crucial toSEO
Semantic elements allow for a more meaningful
expression of the structure of our HTMLpage
NEXT:
Structuring Content with Lists
In this lecture, we will discuss…
Lists
Hands-on Time: Lecture 7
Summary
Lists provide a natural and commonly used grouping of
content
Very often, lists are used for structuring navigation
portions of the web page
NEXT:
HTML Character Entity References
In this lecture, we will discuss…
HTML Character
Entity References
3 Characters You Should Always Escape
NEXT:
Making text hyper with Linking
In this lecture, we will discuss…
Creating Links
Hands-on Time: Lecture 9
Summary
Internal linking to other pages in the site
External linking to other web sites
Linking to sections of a document
NEXT:
Displaying Images
In this lecture, we will discuss…
Displaying Images
Hands-on Time: Lecture 10
Summary
Images can enhance your site
Remember to specify width and height attributes
whenever possible
In this lecture, we will discuss…
Power of CSS
Summary
CSS is an incredibly powerful technology
User experience of content matters
NEXT:
Anatomy of a CSS Rule
In this lecture, we will discuss…
Anatomy of a
CSS Rule
Anatomy of a CSS Rule
Selector
Property Value
p {
color: blu e
} ;
Declaration
Anatomy of a CSS Rule
p {
Zero or More
color: blue;
Declarations
are allowed f o n t - s i z e : 20px;
width: 200px;
}
Anatomy of a CSS Rule
p {
color: blue;
f o n t - s i z e : 20px;
width: 200px;
}
h1 { Stylesheet
color: green;
f o n t - s i z e : 36px;
t e x t - a l i g n : c e n t e r;
}
...
Hands-on Time: Lecture 12
Summary
Syntax of a CSS rule
• Selector
• Declaration
• Property/value pair
Style sheet
NEXT:
Element, class, & id Selectors
In this lecture, we will discuss…
Element, class,
& id Selectors
Element Selector
Element name
p {
color: blue;
}
Element Selector
Blue text
p { ...
color: blue; <p>. . . </ p>
} ...
<p>. . . </ p>
Blue text
class Selector
Class name
.b lue {
color: blue;
}
class Selector
Blue text
...
.b lu e { ...
color: blue; <p c lass= " b l u e " >. . . </ p>
} <p>. . . </ p>
< d i v c lass= " b l u e " >. . . < / d i v >
...
Blue text
Unaffected
class Selector
Defined with . Used without
Blue text
...
...
.b lue { <p c lass= " b l u e " >. . . </ p>
color: b l u e ; <p>. . . </ p>
} < d i v c lass= " b l u e " >. . . < / d i v >
...
Blue text
Unaffected
id Selector
id Value
#name {
color: blue;
}
id Selector
Unaffected
#name { ...
color: blue; <p>. . . </ p>
} < d i v i d = "name">. . . < / d i v >
...
Blue text
id Selector
Defined with #
Unaffected
...
#name { <p>. . . </ p>
color: b l u e ; < d i v i d = "name">. . . < / d i v >
} ...
Blue text
Hands-on Time: Lecture 13
Summary
Syntax simple CSS selectors
• Element
• Class (define with .)
• Id (define with #)
NEXT:
Combining Selectors
In this lecture, we will discuss…
Combining
Selectors
Element With Class Selector
p.b i g {
f o n t - s i z e : 20px;
}
NOTE lack of space between element and class defini8on
Element With Class Selector
Text size 20px
p. b i g { ...
f o n t - s i z e : 20px; <p c lass= " b i g " >. . . </ p>
} < d i v c lass= " b i g " >. . . < / d i v >
...
Unaffected text
Child Selector
a r t i c l e >p{
color: blue;
}
Child Selector
Blue text
<article>. . .
a r t i c l e >p { <p>. . . </ p>
}
color: blue;
...
</article> Unaffected text
a r t i c l e p{
color: blue;
}
Descendant Selector
Blue text
<article>. . .
article p { <p>. . . </ p>
</article> Unaffected text
}
color: blue;
...
<p>. . . </ p>
<article>. . .
<div><p>. . . </ p></ div>
</article>
Blue text
Not Limited To Element Selectors
NEXT:
Pseudo Class Selectors
In this lecture, we will discuss…
Pseudo-Class
Selectors
Pseudo-Class Selector
s e l e c t o r :pseudo-class {
...
}
Pseudo-Class Selector
NEXT:
Style Placement
Hands-on Time: Lecture 16 – Style Placement
In this lecture, we will discuss…
Conflict
Resolution
Some Concepts
origin merge
inheritance specificity
Origin Precedence (when in conflict)
simple rule
Declarations Merge
Hands-on Time: Lecture 17
Inheritance
body
element
DOM element
Tree
element
element
element
Specificity
simple rule
Most Specific
Selector Combination Wins
Specificity (score)
Class, pseudo,
style=“…” ID class, a. ribute # of Elements
1 0 0 0
<h2 style= " c o l o r : green;">
Specificity (score)
Class, pseudo,
style=“…” ID class, a. ribute # of Elements
0 0 0 2
div p { color: green; }
Specificity (score)
d i v #myParag { div. b i g p {
color:
blue;
? }
color: green;
}
0 1 0 1 0 0 1 2
✔
Specificity (score)
d i v #myParag {
X div. b i g p {
}
color: blue; ? }
color: green;
0 1 0 1X 0 0 1 2
0
✔
Hands-on Time: Lecture 17
Summary
Cascade: origin, merge; Inheritance, & Specificity
Provide precise control over targeting content while
allowing maximum re-use of styles across your website
Hands-on Time: Lecture 18 – Text Styling
In this lecture, we will discuss…
margin Content
height
width
Hands-on Time: Lecture 19 – Box Model
Cumulative Margins
90px
Content
Content
40px 50px
Cumulative Margins?
Content
20px
50px?
30px
Content
Cumulative Margins
Content
20px
30px
Margins collapse
30px Content
Hands-on Time: Lecture 19
Summary
Box model – essential to understand
• Prefer box- sizing: border-box
The * (universal) selector
Cumulative and collapsing margins
Content overflow
NEXT:
The background Property
Hands-on Time: Lecture 20 - Backgrounds
Hands-on Time: Lecture 21 – Floating elements
In this lecture, we will discuss…
Relative and
Absolute Element
Positioning
Static Positioning
p{
<p>
}
Relative Positioning
l e f t : 50px;
p {
position: r e l a t i v e ;
top: 50px;
top: 50px; <p>
l e f t : 50px;
}
p{
position: r e l a t i v e ;
bottom: -50 px;
r i g h t : -50 px;
}
bottom: -50px;
Absolute Positioning
p { / * #1 * /
}
1
2
Absolute Positioning
position: relative;
p { / * #1 * /
position: absolute;
21
}
Absolute Positioning
position: relative;
p { / * #1 * /
position: absolute; 2
bottom: 10px;
r i g h t : 10px;
}
1
Absolute Positioning
position: relative;
t o p : 10 px;
l e f t : 10 px;
p { / * #1 * /
position: absolute;
1
bottom: 10px; 2
r i g h t : 10px;
}
Responsive
Design
What device do we need to support?
ALL OF THEM
What is a Responsive Web Site?
1.2
Server
Detect
User6Agent,
i.e., browser
1.3
12-Column Grid Responsive Layout
factors of 12: 1, 2, 3, 4, 6, 12
12-Column Grid Responsive Layout
padding
3 3 3 3
6 6
4 4 4
12-Column Grid Responsive Layout
100%
1 column = 100% / 12 = 8.33%
3 3 3 3
6 6
4 4 4
12-Column Grid Responsive Layout
100%
1 column = 100% / 12 = 8.33%
50% 50%
4 4 4
6 6 3 3 3 3 4 4 4
In this lecture, we will discuss…
Introduction to
Twitter Bootstrap
What is Bootstrap?
NEXT:
Bootstrap Grid System
In this lecture, we will discuss…
The Bootstrap
Grid System
Bootstrap Grid System Basics
Must be inside container (or container-fluid)
Regular content
Regular content
Regular content
Why Negative Row Margin?
browser
.container
.row
Regular content
Regular content
Regular content
Bootstrap Grid System Basics