Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Interaction 03
Interaction 1st semester Malene Patsche Kjeldsen
Today
Intro to CSS
Assignment 1
Links styling them
Colors in CSS
Assignment 2
Responsive images
Borders
Assignment 3
Summary
Interaction 1st semester Malene Patsche Kjeldsen
CSS
Cascading Style Sheet CSS
Goes together with HTML
Styling the code
A rule based language
Examples of CSS
1. Inline CSS
style.css
contact.html
about.html
10
11
12
13
Description
Example
Pixel (px)
width: 200px;
Em (em)
font-size: 2em;
Point (pt)
line-height: 36pt;
Percent (%)
height: 12in;
14
Assignment 1
Make an HTML and CSS file and create a
page that looks similar to below image:
15
16
Styling links
http://www.w3schools.com/css/css_link.asp
Links can be styled different depending on
what state they are in
17
Link states
link: The default state. By default unvisited
links are blue
18
Link states
visited: The style of a link that has
already been visited (clicked on). By
default colored purple
19
Link states
hover: The style when the mouse cursor is
hovering over it
20
Link states
active: The style of a link while it is
activated (as the mouse button is held
down while the pointer is over the link)
21
22
23
Colors in CSS
Keywords:
Hex values:
RGB:
Interaction 1st semester Malene Patsche Kjeldsen
24
Assignment 2
Style your links try different properties and
use the different link states
25
Styling images
Make an image responsive:
26
27
28
29
CSS shorthand
30
Assignment 3
Trying out CSS borders:
Add borders to a website of yours
Try different border styles, colors and
widths
Try to add a border only to the bottom of
an element
Ref: http://www.w3schools.com/css/css_border.asp
31
Homework
Before next class
Make a new project in NetBeans and
create a website consisting of:
at least three HTML-files
an external stylesheet
HTML5 semantic elements
validate the HTML at https://validator.w3.org/
Interaction 1st semester Malene Patsche Kjeldsen
32
Summary
Homework:
See slide 32 and readings in study plan
Next class:
33