School of Computer Science and Software Engineering

CITS3403 Agile Web Development — Lab02

Unit Coordinator

Dr Tim French

Phone: 64882794

Lab Facilitator

Mr Tom Smoker, Mr Haolin Wu

 

Consultation Time

Where: CSSE rm 2.14
Time: Wednesday 12-2pm
No appointment needed.

 

News:

  • [14 Feb 2020] This unit currently has 190 CITS3403 students and 40 CITS5505 students enrolled. Almost twice as many as last year!
  • [14 Feb 2020] Labs, lectures and workshops all start in week 1.
  • [24 Feb 2020] Update: Labs will be starting in week 2.
  • [24 Feb 2020] Welcome to the first day of semester. The first class will be the lecture on Wednesday at 2.


Exercise 2: CSS, Bootstrap, and HTML Media

The aims of this lab are:

  • Practise CSS and Bootstrap
  • to use Google HTML/CSS style guide to sanitize your code
  • to get to know the new media tags <picture>, <audio>, and <video>.
  • to learn the various HTML5 form controls

CSS Tutorial

Run through the basic CSS tutorial at W3Schools, up to Pseudo-element.

Bootstrap Tutorial

Run through the basic Bootstrap tutorial at W3Schools.

Google HTML/CSS Style Guide

Read the first three sections of the Google HTML/CSS Style Guide. This is a local copy obtained from the Github Google Style Repository

While reading, correct your HTML code from last lab to conform with the Google style.

Layout your website using the <table> element

Turn your single page website into a multi-page one. For example, create a page for About me, one for Timetables, one for A collection of links/thoughts/hobbies and one for Contact me. Create a navigation bar to allow for easy navigation across the site. Layout the site using the <table> element. In next lab, we will use CSS positioning together with HTML layout tags <nav>, <header>, <footer> <article> and <section> to do this properly.

HTML Rich Media

Add media files such as images, audios and videos to your website in the HTML5 way, i.e. provide fall backs to ensure cross-browser and cross-platform rendering.

Responsive Images

The <picture> element provides a container for the image source file, where the <img src=""> is always the last element. It uses the media attribute to query and serve different images according to different devices.

For example, you can modify the following code to serve different images to different media. Load this into Gwiddle, and access using your phone and see if it is supported. For a comprehensive set of what element works on which browser, please refer to CanIUse.com.

<picture>
<source media="(min-width: 1024px)"
srcset="fullsize.jpg">
<source media="(min-width: 700px)"
srcset="midsize.jpg">
<img src="crop.jpg" alt="My image">
</picture>

Search on the web for more information about HTML5 responsive images to learn other new features such as the srcset and size attribute as shown in the example below.

<picture>
  <source media="(min-width: 1024px)"
  srcset="fullsize-1x.jpg 1x, fullsize-2x.jpg 2x, fullsize-3x.jpg 3x">
  <img src="crop-1x.jpg" alt="My image" 
  srcset="crop-2x.jpg 2x, crop-3x.jpg 3x">
</picture>

This Page

Last Edited on:
Monday 18th of March 2019 11:46:43 AM

Website Feedback:
[email protected]