Remember that HTML is just text Need to point to pictures Use the img tag alt: › screen reader...

23
Images Multipage Sites

Transcript of Remember that HTML is just text Need to point to pictures Use the img tag alt: › screen reader...

Page 1: 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.

ImagesMultipage Sites

Page 2: 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.

Images

Page 3: 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.

Images in HTML

Remember that HTML is just text Need to point to pictures Use the img tag

<img src=“where” alt=“what”> alt:

› screen reader › REQUIRED for this class and to validate

Page 4: 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.

Where are images used

Pictures Backgrounds Link displays List markers

Page 5: 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.

Picture Sources

Your own Publicly available

› Flickr and the Creative Commons› Google and labeled for reuse

IMPORTANT TO ASSURE NO COPYRIGHT INFRINGEMENT

Page 6: 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.

Adding a caption

<figure><img …><figcaption>caption</figcaption>

</figure>

Page 7: 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.

Images as Background

Page 8: 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.

Overall page design

Default: window size› Advantage: grows and shrinks easily› Disadvantage: harder to design

Making body fixed width› Advantage: easier to control› Disadvantage: scroll bars and unused space

Using fixed width section in default body› Combines advantage of fixed width without scroll

bar› Allows complex backgrounds

Page 9: 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.

Background Image

Body background› Need to assure readability› Simple images (see resources)› For busier images: use overlay

Use div or section or … Opacity (0 to 1) to let it show through

› Background-image Background-size Background-repeat

Page 10: 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.

Multipage Navigation

Page 11: 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.

Structuring Site Navigation

Three possible models› NEXT and PREV (when fixed order)› Navigation bar to the parts› Single page with links (hub & spokes)

When use? Mix and match? Multiple ways?

Page 12: 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.

Guidelines

Link to the exact spot › Heading, not paragraph› Top of the page

Make it easy to get to the navigation (top)

TOO MUCH NAVIGATION IS AS BAD AS NONE!

NEVER DEPEND ON BROWSER BACK BUTTON

Page 13: 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.

Next - Previous

Consistent placement Top, bottom, both Often at the left and right edges

Next class Structurally keep them together Text Images

Page 14: 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.

Navigation Bar

IDENTICAL CONTENT ON ALL PAGES› May want to distinguish current page

Horizontal or Vertical Horizontal best practice

› separate section: nav› inline list› top (below title) or top and bottom

Vertical two styles› Table of contents› Side bar (next week)

Better for long lists Takes width

Page 15: 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.

Page / Site Links

Should you distinguish? Two different bars

› Horizontal (site) and vertical (page)› Color, size, font differentiation

Page 16: 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.

Formatting a Horizontal Nav Bar

Page 17: 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.

Remove bullets from listli { list-style-type: none;}

Make the list horizontalli { display: inline;}

Position <nav> where you want it (left, right, center, top, bottom)

Horizontal navigation formatting: list (1 of 2)

Page 18: 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.

Format the individual link boxesli { border: 1px solid black;

padding: 10px; margin: 0px 1px 0px 1 px;

} Padding will space within box, margin between

boxes› May want to make it negative

Size of box› Vertical: line-height› Horizontal: based on text or define width

Horizontal navigation formatting: list (2 of 2)

Page 19: 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.

Page Layout Reminders

Page 20: 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.

Basic simple design

Focus on layout Simple is best Basic parts

› Header › Nav(igation) – may be in header› Section or div for main body› Footer

Page 21: 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.

Recommendation› Keep nav bar code the same on all pages› Simple copy and paste

This page:› Can use href=“#” or disable link› But then have to remember to change it

Exception:› If you want to format this page differently

Navigation Bar

Page 22: 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.

How to Tailor Layout

Margins Positions Heights

Page 23: 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.

Useful Layout Model: Grid

How wide should your elements be?› Consistency› Enough white space

People have spent time working on it› 978 model

Example