ch 5 html and css web standards solutions a web standardistas’ approach

27
Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

Upload: anne-scarlett-caldwell

Post on 16-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

Ch 5HTML and CSS Web Standards SolutionsA Web Standardistas’ Approach

Page 2: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

Typical image formats used on the Web .jpg, .png, .gif

<img /> in Action - <img src=“your_file_name.jpg” alt=“screen_reader description”/>

One of the few self closing tags - /> To validate an img tag is must be in a block-

level element. This can be achieved for now using:

<p><img src=“your_file_name.jpg” alt=“screen_reader description”/></p>

Provides a reference to where the image is stored in your filing system in relation to the HTML file it appears in.

Page 3: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

width and height attributes tell the browser what dimensions the image should be – typically in pixels.

The browser will reserve space for the image in the HTML.

The title attribute supplies further information about the image.

alt and title serve different purposes: alt – for accessibility purposes title – additional information

alt often appears as a tooltip, but this is only a bonus to all users, not its intended function.

Page 4: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

Creating images can be through: Scanning an image Taking a digital photograph

Editing images can be through the likes of Photoshop

Image optimization Use standard format such as .jpg or .png Compressing without loss of quality is always a

trade-off Use ‘Save for Web’ option were possible

Page 5: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

Size matters Pixels and scaling issues

Bitmap

Vector

Page 6: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

Ch 6HTML and CSS Web Standards SolutionsA Web Standardistas’ Approach

Page 7: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

So far structured markup has allowed for the creation of a single valid Web page.

The Web is all about linking pages together.

What is an ‘Anchor’ It allows the tying together of pieces of

information Creating a relationship between items

Anchors can link pages within a website or link to other websites

Page 8: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

<a href=“place_to_link_to” title=“Additional description”>What will appear in the browser</a>

Typically the hypertext reference (web link) will appear with a blue colour and have an underline. This will change to purple when clicked to show the link has been visited.

Through the use of CSS you have complete control of the styling of the colour and decoration of the links.

Choose the link description carefully to aid accessibility.

Page 9: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

<a href=“place_to_link_to” title=“Additional description”>What will appear in the browser</a>

title attribute It is to offer advisory information about the

element It appears as a Tooltip when the mouse

cursor is held over the link. Screen reader will also read out the text.

Page 10: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

<a href=“place_to_link_to” title=“Additional description”>What will appear in the browser</a>

Links can be either External

<a href=“http://… Outside your site

Local <a href=“folder/file_name Within your site

Internal <a href=“#name Within your webpage

Page 11: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

& needs to be replaced with &amp; < needs to be replaced with &lt; (less than symbol)

Target=“_blank”Sometime it is necessary to open a new window, but this is frowned upon by the W3C guidelines.

Page 12: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

Absolute <a href=“server/folder/file”

It does not matter if the file is stored on a Windows or UNIX based platform ALL will accept “/”

What is “/” ? Typically it is a divider between names on the

path to your file, but it is also the way to anchor to the ‘root’ of the storage of the files.

Best used for linking to external site

Page 13: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

Relative <a href=“../folder/file”

What is “../” ? Typically it is a divider between names on the

path to your file, but it is also the way to move up one directory in the tree and then it is possible to move down another branch.

Best used for linking to internal site pages Whenever you want to take your site to

another machine it preserves the relative interconnections.

Page 14: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

root of website

folders

folders

files

Page 15: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

Move relatively from ‘index.html’ to access the file ‘layout.css’ and include ‘picture.png’

From ‘index.html’ access ‘photo.jpg’

../../css/layout.css

../../../des106/images/photo.jpg/des106/images/photo.jpg

Page 16: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

Root - / top level immediatelyAbsolute

Current folder ./ stay at this level Parent folder ../ move up one level

from where you currently areRelative

Page 17: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

Web servers, Apache and IIS will automatically run the following for static content: index.html index.htm default.html default.htm welcome.html welcome.htm

Page 18: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

Useful Tips

Page 19: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

404 Not Found The browser could not find the specific

document that you requested on the host computer.

To resolve this error, check the Uniform Resource Locator (URL) syntax (some URLs are case sensitive). In addition, the page may have been removed, had its name changed, or have been moved to a new location.

To rise above the mundane, some have made 404 error pages a work of art – see 404 Research Lab (http://www.plinko.net/404/) for some creative 404 pages.

http://help.expedient.com/browsers/errors.shtml

Page 20: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

403 Forbidden/Access Denied The Web site you requested requires

special access permission (for example a password).

503 Service Unavailable The host computer is too busy or

the Web server which hosts the requested Web site is down.

http://help.expedient.com/browsers/errors.shtml

Page 21: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

List of page error codes:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

Page 22: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

One of the hallmark attributes of web standards-based design is the concept that proper use of semantic (X)HTML and CSS completely abstracts the presentation of a site from its content.

One key real-world benefit of this separation is that come redesign time, one only needs to change or replace the CSS stylesheet, and needn’t lay so much as a finger upon the hallowed grounds we call markup.

Source: http://jeffcroft.com/blog/2007/aug/09/myth-content-and-presentation-separation/

Page 23: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach
Page 24: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach
Page 25: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

center color

Page 26: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach
Page 27: Ch 5 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach

Used for storing, controlling, versioning, and publishing industry-specific documentation such as news articles, operators' manuals, technical manuals, sales guides, and marketing brochures. The content managed may include computer files, image media, audio files, video files, electronic documents, and Web content.

CMS made simple Joomla Drupalhttp://pdp.ulster.ac.uk

Source: Wikipedia