Lab Introduction to Cascading Style Sheets

Similar documents
<body bgcolor=" " fgcolor=" " link=" " vlink=" " alink=" "> These body attributes have now been deprecated, and should not be used in XHTML.

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference

Assignments (4) Assessment as per Schedule (2)

CSS: The Basics CISC 282 September 20, 2014

Wanted! Introduction. Step 1: Styling your poster. Activity Checklist. In this project, you ll learn how to make your own poster.

CSS. Lecture 16 COMPSCI 111/111G SS 2018

ICT IGCSE Practical Revision Presentation Web Authoring

CSS Lecture 16 COMPSCI 111/111G SS 2018

Controlling Appearance the Old Way

Reading 2.2 Cascading Style Sheets

Lab 4 CSS CISC1600, Spring 2012

CSS: Cascading Style Sheets

Session 4. Style Sheets (CSS) Reading & References. A reference containing tables of CSS properties

CSS.

<style type="text/css"> <!-- body {font-family: Verdana, Arial, sans-serif} ***set font family for entire Web page***

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

HTMLnotesS15.notebook. January 25, 2015

Appendix D CSS Properties and Values

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student

Review Question 1. Which tag is used to create a link to another page? 1. <p> 2. <li> 3. <a> 4. <em>

Page Layout Using Tables

Introduction to WEB PROGRAMMING

CSS Cascading Style Sheets

Using Dreamweaver CS6

1 Creating a simple HTML page

CREATING A WEBSITE USING CSS. Mrs. Procopio CTEC6 MYP1

Cascading Style Sheets Level 2

Html basics Course Outline

The Importance of the CSS Box Model

In the early days of the Web, designers just had the original 91 HTML tags to work with.

CSS for Styling CS380

CS 350 Internet Applications I Name: Exam II (CSS) October 29, 2013

ADDING CSS TO YOUR HTML DOCUMENT. A FEW CSS VALUES (colour, size and the box model)

Cascading Style Sheets (CSS)

Chapter 3 Style Sheets: CSS

CSS مفاهیم ساختار و اصول استفاده و به کارگیری

ICT IGCSE Practical Revision Presentation Web Authoring

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

Web Programming and Design. MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh

HTML & CSS. Rupayan Neogy

Three Ways to Use CSS:

Lab 2: Movie Review. overview.png background.png rottenbig.png rbg.png fresh.gif rotten.gif critic.gif

Web Design and Development Tutorial 03

HTML and CSS COURSE SYLLABUS

Deccansoft Software Services

2. Write style rules for how you d like certain elements to look.

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

Introduction to Web Tech and Programming

DAY 4. Coding External Style Sheets

COMS 359: Interactive Media

Cascading Style Sheet. Styles as Tag Attributes. Syntax. <h1>: what font type/size is used? STYLE = SELECTOR {RULES} Attributes such as bgcolor

Styles, Style Sheets, the Box Model and Liquid Layout

CSS: formatting webpages

Note: The screenshots in this document were taken on Windows in Firefox, which may differ from your system.

CSC9B1: Essential Skills WWW 1

WEB DESIGN: CONSTRUCTION, FILES, CODE AND COLOURS UNIT NUMBER: H383 34

To link to an external stylesheet, the link element is placed within the head of the html page:

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo

HTML/XML. HTML Continued Introduction to CSS

Introduction to Cascading Style Sheet (CSS)

VISA/APCO/STAC 2P61 WEBSITE CREATION Fall Term 2012

To illustrate how to set TAG styles the <body> and <h1> tags (for the BODY and the HEADING 1 styles) will be adjusted.

Taking Fireworks Template and Applying it to Dreamweaver

ACSC 231 Internet Technologies

Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style

CSS Cascading Style Sheets

CSS Design and Layout Basic Exercise instructions. Today's exercises. Part 1: Arrange Page into Sections. Part 1, details (screenshot below)

COSC 2206 Internet Tools. CSS Cascading Style Sheets

Basic CSS Lecture 17

Overview. Part I: Portraying the Internet as a collection of online information systems HTML/XHTML & CSS

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

The Benefits of CSS. Less work: Change look of the whole site with one edit

CSS Tutorial Part 1: Introduction: A. Adding Style to a Web Page (3 options):

.hedgehog { background-image: url(backyard.jpg); color: #ffff99; height: 6in; width: 12in; } .tube {

CSC 337. Cascading Style Sheets. Marty Stepp, Rick Mercer

Website Development with HTML5, CSS and Bootstrap

Introduction to CSS. Part 1: Simple Text Formatting. Source Files for this Exercise are available on the Course Website DW_CSS intro

**Method 3** By attaching a style sheet to your web page, and then placing all your styles in that new style sheet.

[AVWSQ-ADWCS6]: WSQ ICDL Adobe Dreamweaver CS6

ITNP43: HTML Lecture 4

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2)

CSS Styles Quick Reference Guide

3.1 Introduction. 3.2 Levels of Style Sheets. - HTML is primarily concerned with content, rather than style. - There are three levels of style sheets

CISC1600-SummerII2012-Raphael-lec3 1

Using Dreamweaver CS6

Web Design and Development ACS Chapter 12. Using Tables 11/23/2017 1

Cascading style sheets, HTML, DOM and Javascript

Text and Layout. Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 11. This presentation 2004, MacAvon Media Productions

Adding CSS to your HTML

Designing for Web Using Markup Language and Style Sheets

CSC 443: Web Programming

- HTML is primarily concerned with content, rather than style. - However, tags have presentation properties, for which browsers have default values

2005 WebGUI Users Conference

Using Dreamweaver CC. 6 Styles in Websites. Exercise 1 Linked Styles vs Embedded Styles

COMP519 Web Programming Lecture 6: Cascading Style Sheets: Part 2 Handouts

ID1354 Internet Applications

3.1 Introduction. 3.2 Levels of Style Sheets. - The CSS1 specification was developed in There are three levels of style sheets

- The CSS1 specification was developed in CSS2 was released in CSS2.1 reflects browser implementations

APPLIED COMPUTING 1P01 Fluency with Technology

Transcription:

Lab Introduction to Cascading Style Sheets For this laboratory you will need a basic text editor and a browser. In the labs, winedt or Notepad++ is recommended along with Firefox/Chrome For this activity, you will need to download the lab materials from http://www.barryavery.com Task 1 Downloading resources for this lab From the URL above, download the CSStask1.zip file and extract all three files into the same location. You should have three files: flashdrives.html memoryusb.jpg style.css XHTML text for the flash drives page Image file required for flashdrives.html Style file Open flashdrives.html in a text editor and read it through so you can see the semantic markup. You should be able to see a main heading (h1), two sub headings (h2), two paragraphs (p) and an image. Open the file in a browser and ensure that it looks like the screenshot if the image is missing check that you have downloaded and extracted all three files into the same location. Task 2 Adding a link to the style file Use a text editor to add a link to the style file into flashdrives.html to do this add the link line into the head:- <link rel="stylesheet" type="text/css" href="style.css" /> Reload the file in a browser to see an immediate change. Task 3 Change the background and font color for the whole page Open the file style.css in text editor you should have 4 selectors, for the body, h1, h2 and paragraph elements. Change the file to set the background color to teal, and the font color to white (remember the American spelling). body { background-color: teal; color: white; 1

Task 4 Change the h1 and h2 headings Edit the style file to add properties to the h1 and h2 selector as follows: h1 should have a background- color of silver, with a font color of navy h1 font family is impact (hint - use font-family: impact; ) h2 should have background- color of navy Task 5 A completely new style Edit the style file to try to emulate the design shown (you can see this in colour on the ITB lab 3 web page). Hints: the body background is teal, with the Arial font h1 uses navy and silver with a font- size of 200% and a text- align setting of center h2 uses a background colour of #255780 with a white font aligned p uses Lucida Grande (put it in double quotes because of the space in the font name) Task 6 Retro style Edit the style file to try to emulate the design shown. Hints: the body background is black, with the Arial font h1 uses Courier New with a font- size of 200% and aligned text Task 7 Black and white for printing Edit the style file to try to emulate the design shown. Hints: the body uses an Arial font h1 uses a font- size of 200% and border: 1px solid black h2 uses a silver background and border: 1px solid black p uses Lucida Grande Reload the file in a browser to ensure the changes work. 2

blocks, borders and margins Task 8 Downloading resources for this lab From the URL, download the CSStask8.zip file and extract all the files into the same location. Tasks 9 to 16 require two files and use tag style selectors browsers.html firefox.png XHTML text for the browsers page Image file required for browsers.html Open browsers.html in a text editor and read it through so you can see the semantic markup. You should be able to see a main heading (h1), two sub headings (h2), two paragraphs (p) and an image. Open the file in a browser and ensure that it looks like the screenshot if the image is missing check that you have downloaded and extracted the files into the same location. Task 9 Adding a link to a style file Use a text editor to add a link to a style file into browsers.html to do this add a link line into the head:- <link rel="stylesheet" type="text/css" href="style.css" /> Task 10 Changing the h1 elements block level layout and box model Add a tag style selector for the h1 element to the style file and use it to make the h1 element block and floated to the right h1 { display: block; float: right; Check browsers.html in a browser window to ensure the block/float effect. Edit the style file to change the box model for the h1 element (use the lecture notes for the selectors and properties required):- Make the border- style solid Add padding and a margin of 10pt Add a border- width of 1pt Reload the file in a browser to ensure the changes work. 3

Task 11 Styling the body Add a tag style entry for the body tag. This can be styled in the same way as any other block - as documents only have one body we don t need to use id or class styling here: Make the border- style solid Add a border- width of 1pt Add a border- color of black Add a margin of 15pt Add a padding of 5pt Make the font- family: Arial, Sans- serif Task 12 Styling the h2 elements Add a tag style entry for the h2 elements. Style the h2 elements as follows: Make the border- bottom solid Make the width 40% Make the border- width 1pt Reload the file in a browser to ensure the changes work. Task 13 Styling the image Add a style to the style file to turn the image into a block style element - then float it to the right and add a solid black border (with width 1pt). You may need to add a margin (suggested value 3pt) Reload the file in a browser to ensure the changes work. 4

Task 14 Styling the list Add a style to the style file to turn the list items into an inline style element. Then add padding and a margin to the left and right of each item (of 5pts). Finally add a black solid border of 1pt width. Reload the file in a browser to ensure the changes work. Task 15 A completely new style Create a new style sheet for the design shown on the right. Here are some hints: Draw solid black borders around the h2 and paragraph elements - the h1 element needs a border on the top and bottom. Invert the colours of the h2 element, and alter the body typeface to match one shown in the picture. Finally, float the image and shrink the margin and padding between the h2 and p elements. Task 16 A completely new style Create a new style sheet for the design shown on the right. Here are some hints: The trick here is to add left padding to the body tag, then to add negative margins to the h1 and h2 elements (for example - 6em). You will need to add padding and style to the other elements (a sans- serif font to h1 and h2, with serif for the rest). 5

Task 17 Styling a table Tasks 17-19 use the file browserstats.html. Open the file in an editor and browser so you understand the markup. Create a new style sheet for the design shown on the right / add an appropriate link line to browserstats.html Hints: Add a font- family to the body (arial) and place a border round the table, 1px in width, solid colour #797979 Task 18 Styling the cells Add tag style selectors to the CSS file to style the th and td elements:- Hints: Both th and td elements require padding on the right (5px), the text to be aligned in the centre and a solid bottom border (1px). th uses a border colour #000, whilst td uses a border colour #DDD, (remember the American spelling). Task 19 Styling the rows using class selectors If we want the rows to be different colours, we have to add some differentiating markup to the HTML file (we cannot style the rows differently as they are all tr elements) Edit browserstats.html so that alternate rows have the classnames odd and even, by using the class attributes for tr Now edit the style file to make the background colour of the odd rows be #9cd7a7 and the even rows be #c9ffd4. Remember that class selectors are added to a style file using the.name notation.odd {.even { 6