Web Design & UI - UX (PDFDrive)
Web Design & UI - UX (PDFDrive)
CSS
But first…
My Take on
Web
Development
There is always some
tool that makes your
life easier.
Hypertext Markup Language
The language your web browser uses to describe
the content and structure on web pages
But first…
My Take
on
HTML
HTML = Nested
Boxes
HTML = Nested
Boxes™
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body>
</html>
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body>
</html>
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body>
</html>
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body>
</html>
HTML
TagsOpening tag
<html>
</html>
Closing tag
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body>
</html>
HTML
Tags
<a>
<b>
</a>
</b>
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body>
</html>
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body>
</html>
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body>
</html>
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body>
</html>
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body>
</html>
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body>
</html>
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body>
</html>
Basic HTML
Elements
<html> Root of HTML
<head> Document Info about
<body> Document Document
<h1>, <h2>, <h3>, … Body
<p> Header tags
Paragraph tags
Basic HTML
Elements
<html> Root of HTML
<head> Document Info about
<body> Document Document
<h1>, <h2>, <h3>, … Body
<p> Header tags
Paragraph tags
Inserting
<a> Links Link
Link to 6.148!
HTML
Attributes
attribute value
Opening tag
</a>
Closing tag
Inserting
Links
<a href="http://6148.io">Link to 6.148!</a>
Link to 6.148!
Inserting
Links
<a href="home.html">Link to home!</a>
Link to home!
Inserting
Images
<img> Image
Inserting
Images
<img src="pusheen.gif"></img>
Inserting
Images
<img src="pusheen.gif">
Inserting
Images
<img src="pusheen.gif">
app/
hello.html
pusheen.gif
Inserting
Images
<img src="pusheen.gif">
<img src="images/pusheen.gif">
app/
hello.html
images/
pushee
n.gif
Lists
<ol> Ordered List (1, 2, 3…)
<ul> Unordered List
(bullets)
<li> List Item
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<ul>
</ul>
</body>
</html>
hello.html
<!DOCTYPE html>
<html> • Item 1
<head>
<title>Title!</title>
</head>
<body>
<ul>
<li>Item 1</li>
</ul>
</body>
</html>
hello.html
<!DOCTYPE html>
<html> • Item 1
<head> • Item 2
<title>Title!</title>
</head>
<body>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
</body>
</html>
div &
<div> spanBlock Section in
<span> Document Inline Section
in Document
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body>
</html>
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<div>
<h1>Heading!</h1>
<p>Paragraph!</p>
</div>
</body>
</html>
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<div>
<h1>Heading!</h1>
<p>Paragraph!</p>
</div>
</body>
</html>
<span>?</span>
the real way to
learn
Web
Dev
Step 1:
Google!
the real way to
learn
Web
Dev
Step
2:
Learn.
the real way to
learn
Web Dev
Hypertext Markup Language
The language your web browser uses to describe
the content and structure on web pages
Cascading Style Sheets
The rules that tell your web browser how stuff
looks
But first…
My Take
on
CSS
CSS = A list
of
descriptions
p{
color: red;
font-family: Arial;
font-size: 24pt;
}
selector
p{
color: red;
font-family: Arial;
font-size: 24pt;
}
selector
property
p{
color: red;
font-family: Arial;
font-size: 24pt;
}
selector
property
p{ value
color: red;
font-family: Arial;
font-size: 24pt;
}
hello.html
<!DOCTYPE html>
<html> Heading
<head>
<title>Title!</title> Paragraph!
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body
>
</html>
hello.html Heading
<h1>Heading!</h1> Paragraph!
<p>Paragraph!</p>
hello.html Heading
<h1>Heading!</h1> Paragraph!
<p>Paragraph!</p> Info
<p>Info</p>
hello.html
<h1>Heading!</h1>
<p>Paragraph!</p>
<p>Info</p>
Heading
Paragraph!
style.css Info
p{
color: red;
font-family: Arial;
font-size: 24pt;
}
hello.html
<h1>Heading!</h1>
<p>Paragraph!</p>
<p class="info">Info</p>
Heading
Paragraph!
style.css Info
p{
color: red;
font-family: Arial;
font-size: 24pt;
}
hello.html
<h1>Heading!</h1>
<p>Paragraph!</p>
<p class="info">Info</p>
Heading
Paragraph!
style.css Info
.info {
color: red;
font-family: Arial;
font-size: 24pt;
}
hello.html
<h1>Heading!</h1>
<p>Paragraph!</p>
<p id="unique">Info</p>
Heading
Paragraph!
style.css Info
#unique
{ color:
red;
font-family: Arial;
font-size: 24pt;
}
Class vs
Class ID ID
Can use the same class Each element can
on multiple elements have only one ID
Can use multiple Each page can have
classes on the same only one element with
element that ID
Class vs
Class ID ID
Can use the same class Each element can
on multiple elements have only one ID
Can use multiple Each page can have
classes on the same only one element with
element that ID
#id {
.classname { …
… }
}
Combining
HTML &
CSS
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body>
</html>
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Title!</title>
<link rel="stylesheet"
type="text/css"
href="style.css">
</head>
<body>
<h1>Heading!</h1>
<p>Paragraph!</p>
</body>
</html>
In
Conclusion:
HTML = nested boxes!
CSS = a list of descriptions
2
Exercise 1: Kitten
Started
Open
in
profile1.html
chrome to see
what it looks like.
Change the name,
description, and status
to your choice.
BORDER
PADDIN
CONTENT
Exercise 2: Feline
Good
Make a class called “text-center” in style2.css
The class should make any element that has the
class
have centered text.
.text-center {
text-align: center;
}
What is
•
Bootstrap?
A collection of CSS Classes that add
prebuilt styles to your webpage.
Open BS/styleBS.css
Be amazed by how little CSS there is
Bootstrap
Time!!
The most important
line:
How to use
Bootstrap
1. Open Documentation
2. Look for something that you
like
3. Copy the code tutorial,
modify for your own
purposes
4. Smile at how easy that was
How to use
Bootstrap