html and style. session overview leveling-off on the basic concepts of html and styles discuss web...

14
HTML and Style

Upload: vivien-craig

Post on 29-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: HTML and Style. Session overview Leveling-off on the basic concepts of HTML and Styles Discuss Web authoring options

HTML and Style

Page 2: HTML and Style. Session overview Leveling-off on the basic concepts of HTML and Styles Discuss Web authoring options

Session overview

• Leveling-off on the basic concepts of HTML and Styles

• Discuss Web authoring options

Page 3: HTML and Style. Session overview Leveling-off on the basic concepts of HTML and Styles Discuss Web authoring options

Learning Outcomes

At the end of this session you will be able to:

• Recognise HTML document structure, distinguishing between elements and attributes

• Translate RGB to Hex values for describing colour in HTML

• Compare methods of adding style information to HTML documents

Page 4: HTML and Style. Session overview Leveling-off on the basic concepts of HTML and Styles Discuss Web authoring options

HTML Fundamentals

• Elements are HTML instructions

• Attributes specify certain parameters

Page 5: HTML and Style. Session overview Leveling-off on the basic concepts of HTML and Styles Discuss Web authoring options

HTML document structure

• HTML tags need to be nested in order (like Russian dolls)

<HTML>

<HEAD>[information about the document]</HEAD>

<BODY>[data to appear on browser page]</BODY>

</HTML>

Page 6: HTML and Style. Session overview Leveling-off on the basic concepts of HTML and Styles Discuss Web authoring options

Document structure (cont.)

• Structure sections of HTML in a similar way to how documents are encoded in a Word processor:

<h1><h2>

<h3>

Page 7: HTML and Style. Session overview Leveling-off on the basic concepts of HTML and Styles Discuss Web authoring options

Learning more about HTML

• HTML is dead!

• Smarter applications to generate web code automatically

• Convergence and community

Page 8: HTML and Style. Session overview Leveling-off on the basic concepts of HTML and Styles Discuss Web authoring options

Colour on the Web

• Image file formats– JPG– GIF– PNG

• RGB and Hex

• 216 ‘Web-safe’ colours

Page 9: HTML and Style. Session overview Leveling-off on the basic concepts of HTML and Styles Discuss Web authoring options

HTML style (the old way)

<P><font face=”Arial, Helvetica” size=”2” color=”#336699”> Hello</font></P>

• In mid-90s, this was the only way to change browser default styles

• Whenever you want to update the look and feel of that page, you will need to change each individual style statement. This can be very tedious!

• In stricter versions of HTML and particularly XHTML, HTML styles are not permitted

Page 10: HTML and Style. Session overview Leveling-off on the basic concepts of HTML and Styles Discuss Web authoring options

Cascading style sheets - CSS

• A language distinct from HTML

• CSS can control the style of any HTML element. Additionally, you can create classes of HTML elements

• Integrity of HTML code can be maintained for usability in multiple environments, while more powerful style control can be achieved and managed separately

Page 11: HTML and Style. Session overview Leveling-off on the basic concepts of HTML and Styles Discuss Web authoring options

CSS...

• Replaces the need for HTML tables and styles… sort of.– Internet Explorer 3+– Netscape Navigator 4+ – Opera 3+

• CSS can control the style of any HTML element. Additionally, you can create classes of HTML elements

Page 12: HTML and Style. Session overview Leveling-off on the basic concepts of HTML and Styles Discuss Web authoring options

CSS and HTML

• When using CSS, it is very important to use HTML tags for the purpose designed.

• Think about what a tag means instead of what effect it has, and use it for that purpose.

Page 13: HTML and Style. Session overview Leveling-off on the basic concepts of HTML and Styles Discuss Web authoring options

Using CSS in HTML

• 3 ways to add CSS to Web documents (the ‘cascade’)– linked stylesheet – in <head> – in-line

Page 14: HTML and Style. Session overview Leveling-off on the basic concepts of HTML and Styles Discuss Web authoring options

Summary

• HTML is a language to create Web documents. It is superceded by XHTML, but will continue to work in browsers for a few years. HTML tags provide structure for text or other information in a document.

• There are 216 Web-safe colours. While you can use 16million colours, if a user’s monitor cannot display that colour, their computer will ‘dither’ to the nearest colour. To anticipate this, use the Web-safe palette or adaptive dither.

• There are four ways to encode style information in HTML documents: The HTML Styles method if you don’t use CSS. Top-of-the-page styles The linked CSS document Inline styles