220 likes | 411 Views
MORE CSS!. 11/6 /1 3. Today’s Agenda. Review : float for positioning objects Review: CSS and color Introductions to: CSS and images CSS backgrounds CSS and fonts Activity: bring more style to your structure. Review: CSS Float. Why do we use float ?
E N D
MORE CSS! 11/6/13
Today’sAgenda • Review: float for positioning objects • Review: CSS and color • Introductions to: • CSS and images • CSS backgrounds • CSS and fonts • Activity: bring more style to your structure
Review: CSS Float • Why do we use float? • What, technically, does float do to objects? (think about the box model here)
Float and the "Inverted L" • Which object was floated? Why? • How did we change other objects to accommodate the floated object?
Discuss • What DOM object is parent of everything? • Can we style that parent object? • Hint: yes, and everything today is related
Review: CSS and color • How do we write color declarations? • What objects are affected by color? • What three ways do we define color?
Short Activity: backgrounds • Create a new HTML doc in Thimble • Add the following to the document: • container <div> with: • 2 headers • 5 paragraphs (enough to get a vertical scroll) • style tags for CSS
CSS for object backgrounds: color • Working with solid colors • style="background-color:red" • same methods for color as color declaration • Apply a background color to your headers
CSS for object backgrounds: images • Make an image the background of an object • Can be applied to any object • image -> css = image -> html • Declaration: • background-image: url(VALUE); • VALUE can be absolute or relative path • Give your container <div> a background • http://www.teacherfiles.com/clipart/xbackgrounds/lined_paper_light.jpg
CSS for object backgrounds: images • Background images repeat horizontally and vertically • Control repetition: • background-repeat: VALUE; • Options: repeat | repeat-x | repeat-y | no-repeat • Experiment on your background • set to repeat only horizontally • set to repeat only vertically
CSS for object backgrounds: images • Define how a background scrolls • Usually limited to non-repeating backgrounds • Control attachment: • background-attachment: VALUE; • Options: scroll | fixed • Experiment on your background • set background-repeat to no-repeat • background-attachment: fixed;
CSS for object backgrounds: images • Position where a background image appears • Control position: • background-position: VALUE; • Options: left, center, right, top, center, bottom • Choose both horizontal and vertical (eg left bottom) • Experiment on your background • set background-repeat to no-repeat • background-position: top right;
CSS for object backgrounds: images • Discuss: • use cases for background image vs <img /> • <body> object • other objects • advantages / disadvantages of both methods
Discuss: <body> styles • background • font • margin • padding • use cases for all
Review what we already know: fonts • Why are fonts tricky on the web? • Why can't we use Google Fonts in AFS? • How does that limit our designs?
CSS and fonts • Why are fonts tricky on the web? • Why can't we use Google Fonts in AFS? • How does that limit our designs? • How have we transformed font already?
CSS and fonts • font-weight: bold; • font-style: italic; • text-decoration: underline;
CSS and fonts: font-family • Define the specific font you want • Define "fallback" fonts - fonts to use if the browser can't find the ones you specified
Activity: Get to Work • Begin implementing styles in your structure • background • font • color • Consult existing design documents
For Next Time • Continue developing your landing pages • Refine structures • Apply visual styles • Make sure to maintain separation of content from presentation
For Next Time • 30 CSS Selectors You Must Memorize • CSS Pseudo-classes • CSS3 Files (explore entire site) • Tool: CSS3 border-radius • Tool: CSS3 Generator • About Agile Development • About Scrum
For NEXT TIME • Develop rough work plan for next 3 sessions • Assess what you've done so far • What you need to do to finish your landing pages • Estimate how much work will be needed to build your sub-pages • Obstacles - what do you still need to learn to build your site? (e.g. implementing Twitter feeds) • Be prepared to discuss your rough plan