J ENWARE Chapters 14 & 15 Learning Web Design, Fourth Edition by Jennifer Niederst Robbins Copyright © 2012.

Slides:



Advertisements
Similar presentations
Copenhagen, 6 December 2004 Modern CSS Principles Miruna Bădescu Finsiel Romania.
Advertisements

Chapter 3 – Web Design Tables & Page Layout
HIGH LEVEL OVERVIEW: CSS CSS SYNTAX CONSISTS OF A SET OF RULES THAT HAVE 3 PARTS: A SELECTOR, A PROPERTY, AND A VALUE. IT’S NOT NECESSARY TO REMEMBER THIS.
Internet Services and Web Authoring (CSET 226) Lecture # 5 HyperText Markup Language (HTML) 1.
Cascading Style Sheets
Cascading Style Sheets
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Today CSS HTML A project.
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Very quick intro HTML and CSS. Sample html A Web Title.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
Principles of Web Design 5 th Edition Chapter Nine Site Navigation.
SM5312 week 11: CSS Menus & Navigation Bars1 An Introduction to Cascading Style Sheets CSS Menus and Navigation Bars Nick Foxall.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
Building a Website: Cascading Style Sheets (CSS) Fall 2013.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
Navigation Bars Level 2 Extended Certificate Unit B12 Doing Business Online.
1 Dreamweaver CS5 intermediate class by Cookie Setton Build a CSS website WITHOUT TABLES Just when you thought you were starting to understand HTML coding,
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
Class four: the box model and positioning. is an HTML tag which allows you to create an element out of inline text. It doesn’t mean anything! try it:
Chapter 8 Creating Style Sheets.
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
Tutorial 4: Creating page layout with css
Today’s objectives Site performance Padding, Margins, Borders
Week 9 Using the Box Properties. 9-2 The CSS Visual Formatting Model Describes how the element content boxes should be displayed by the browser –Based.
MORE Cascading Style Sheets (The Positioning Model)
4.01 Cascading Style Sheets
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
IMAGES Controlling size of images in CSS Aligning images in CSS Adding background images.
ITP 104.  While you can do things like this:  Better to use styles instead:
1 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles are normally stored in Style Sheets  Styles.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
 Word doc for you to download › Link at the beginning of class › 10 Questions › Answers to be added inline  Post to Sakai when completed › No resubmits.
 Remember that HTML is just text  Need to point to pictures  Use the img tag  alt: › screen reader › REQUIRED for this class and to validate.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
Web Development & Design Foundations with HTML5 7th Edition
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
Understanding CSS Cascading Style Sheets control the presentation of content in HTML pages Style Sheets separate formatting from the content –Styles defined.
 Add one element at a time  If it doesn’t do what you want, › Delete it › DON’T just keep piling on more items.
Chapter 7.  Change body and link styles  Create a drop-down menu  Change color and font styles in the menu  Create a pop-up effect using CSS  Utilize.
Chapter 4 and 5. Objectives Introduce markup: elements and attributes How browsers interpret HTML documents Basic structure of HTML document What do style.
NAVIGATION USING HTML TO SET UP THE BASIC STRUCTURE OF A NAV BAR.
CSS.
Cascading Style Sheets Boxes
4.01 Cascading Style Sheets
( Cascading style sheet )
CSS Layouts: Grouping Elements
Creating Page Layouts with CSS
Floating & Positioning
Advanced CSS BIS1523 – Lecture 20.
Cascading Style Sheets (Layout)
Creating a Baseline Grid
CSS Applications to XML 19-Sep-18.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Basics of Web Design Chapter 7 Page Layout Basics Key Concepts
Objectives Create a reset style sheet Explore page layout designs
Cascading Style Sheets
Laying out a website using CSS and HTML
Fixed Positioning.
CSS Borders and Margins.
Second CSS Lecture Applications to XML
MORE Cascading Style Sheets (The Positioning Model)
How to use the CSS box model for spacing, borders, and backgrounds
Laying out Elements with CSS
4.01 Cascading Style Sheets
CSS Applications to XML 20-May-19.
CSS Applications to XML 3-Jul-19.
Presentation transcript:

J ENWARE Chapters 14 & 15 Learning Web Design, Fourth Edition by Jennifer Niederst Robbins Copyright © 2012

Download the jenware file from the class web site. Start by opening jenware.html in a browser and a text editor to see what you’ve got to work with. pg 315 Learning Web Design, Fourth Edition by Jennifer Niederst Robbins Copyright © 2012 Text Editor (notepad) Browser Window S ET U P

D OCUMENT B ASICS The document has been divided into two main div elements (“intro” and “content”), and the #content div is divided again into “products” and “testimonials”. The background colors have been added to the body, #nav, #products, and #testimonials divisions. There is also a gradient at the top of the page and an exclamation point image to the background of the “testimonials” div. The remaining rules are for formatting text.

CSS CHANGES The first thing we’ll do is add padding to the “products” div. One em of padding all around ought to be fine. Find the #products selector and add the padding declaration. pg 315 Learning Web Design, Fourth Edition by Jennifer Niederst Robbins Copyright © 2012

Next, we’ll get a little fancier with the “testimonials” section. Clear some space in the left side of the div so that the nifty exclamation-point background image is visible CSS CHANGES

We’ll start with the basics by using the shorthand border property to add a light-orange (#FFBC53) double rule around the “products” area. The shade should be light enough as to not call too much attention to itself. Add the new declaration to the rule for the “products” div. CSS CHANGES – BORDER TRICKS

Next, let’s give the “testimonials” section rounded corners. They won’t show up for Internet Explorer 6–8 and some other old browser versions, but that doesn’t really hurt anything. CSS CHANGES – BORDER TRICKS

We’ll add a decorative border on two sides of the product category headings (h3). I want the borders to be the same color as the text, so we don’t need to specify the border-color. Find the existing rule for h3 elements in the “products” div, and add a declaration that adds a 1-pixel solid rule on the top of the headline. Add another declaration that adds a thicker, 3-pixel solid rule on the left side. Finally, to prevent the text from bumping into that left border, we can add a little bit of padding (1em) to the left of the headline content. CSS CHANGES – BORDER TRICKS

The next thing we’ll do is replace the standard text underline under links with a decorative bottom border. Start by turning the underline off for all links by setting the text-decoration to none for the a element. Add this rule in the "link styles" section of the style sheet. Add a 1-pixel dotted border to the bottom edge of links by adding this declaration to the a rule. CSS CHANGES – CHANGING LINKS You need to add all of this element.

As is often the case when you add a border to an element, it is a good idea to also add a little padding to keep things from bumping together. Add some padding to the bottom edges only, like so: CSS CHANGES – CHANGING LINKS

It is common practice to set the margin for the body element to zero, thus clearing out the browser’s default margin setting and creating a starting point for setting our own margins on elements throughout the page. CSS CHANGES – ADDING MARGINS

Start with the #intro div, and add a 2-em margin on the top and 1em below. We also want to close up the space between the logo and the tagline, so set the bottom margin on the h1 to zero and the top margin on the h2 to –10px to move the tagline up nice and close to the logo. Finally, put a 1-em margin all around the introductory paragraph (p). CSS CHANGES – ADDING MARGINS

Now add a 2.5em space above the products subsection headings (h3). section. CSS CHANGES – ADDING MARGINS

Finally, we’ll set apart the Testimonials box by adding 1em of space above and 10% on the left and right edges. This time, see if you can figure it out on your own. CSS CHANGES – ADDING MARGINS

We’ll start by removing wasted vertical space next to the product images by floating the images to the left. We’ll use a contextual selector to make sure that we float only those images in the “products” section of the page. While we’re at it, let’s add a little margin on the right and bottom sides using the margin shorthand property. CSS CHANGES – FLOATING IMAGES

Next, I’d like the “More about…” links to always appear below the images so they are clearly visible and consistently on the left side of the products section. This change is going to require a little extra markup because we need a way to target just the paragraphs that contain “more about” links. Add the class name “more” to each of the paragraphs that contain links. Here is the first one: CSS CHANGES –

Now we can use a class selector to make those paragraphs clear the floated images. CSS CHANGES –

Start by making the ul element as neutral as possible. The bullets have already been turned off, but we should clear out any padding and margin that might be happening in there. CSS CHANGES – MAKING A NAVIGATION BAR Next float the list items to the left, and clear the following products div.

Save the document and take a look at it in a browser. You should see that the links are now lined up pretty tightly, but also that the purple navigation bar has shrunk to nothing—float containment fail! Let’s fix it with the overflow technique. And while we’re at it, let’s do the same for the #products div so it is sure to contain the floated images. CSS CHANGES – MAKING A NAVIGATION BAR

Now we can work on the appearance of the links. Start by making the a elements display as block elements instead of inline. Instead of setting specific dimensions for each link, we’ll use padding (.5em) to give them a little breathing room inside the border and use margins (.25em) to add space between links. I’ve added a lavender border as the default, but I brighten it up to white for the :focus and :hover states. CSS CHANGES – MAKING A NAVIGATION BAR

Finally, let’s center the list in the width of the nav section. We can do this by applying a width to the ul element and setting its side margins to auto. I confess that I had to fiddle around with a few width measurements to arrive at one that fit the entire menu just right (19.5em). If it’s too wide, the menu won’t be truly centered. CSS CHANGES – MAKING A NAVIGATION BAR

pg 353 Learning Web Design, Fourth Edition by Jennifer Niederst Robbins Copyright © 2012