Cascading Style Sheets (CSS) for Websites Exercise

Similar documents
Creating Web Pages With Dreamweaver MX 2004

Basic tutorial for Dreamweaver CS5

Contents. Downloading the Data Files Centering Page Elements... 6

KOMPOZER Web Design Software

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. Web Design in Nvu Workbook 2

CST 150 Web Design I CSS Review - In-Class Lab

Contents. Introduction Downloading the Data Files... 2

Microsoft Expression Web Quickstart Guide

Microsoft Expression Web

Using Adobe Dreamweaver CS4 (10.0)

Using Microsoft Word. Working With Objects

Web Design Basics. Cindy Royal, Ph.D. Associate Professor Texas State University

CREATING A NEWSLETTER IN ADOBE DREAMWEAVER CS5 (step-by-step directions)

Recreate your Newsletter Content and Layout within Informz (Workshop) Monica Capogna and Dan Reade. Exercise: Creating two types of Story Layouts

Dreamweaver CS4 Day 2 Creating a Website using Div Tags, CSS, and Templates

Creating Web Pages with Dreamweaver CS 6 and CSS

Website Development Komodo Editor and HTML Intro

RIT Message Center Compose and Send Messages

TUTORIAL 4 Building a Navigation Bar with Fireworks

Sage Accountants Business Cloud EasyEditor Quick Start Guide

{color:blue; font-size: 12px;}

Basics of HTML (some repetition) Cascading Style Sheets (some repetition) Web Design

Exercise 4 - Practice Creating Text Documents Using WordPad

Intro to Web Development

General Electric Foundation Computer Center. FrontPage 2003: The Basics

Using an external style sheet with Dreamweaver (CS6)

Web content vs. Word Processing Files

Digital Marketing EasyEditor Guide Dynamic

Basic Web Fullerton College

How to - Newsletter & Memo Section

HTML TIPS FOR DESIGNING

ITNP43: HTML Lecture 4

ITP 101 Project 3 - Dreamweaver

Basic Website Creation. General Information about Websites

HIT THE GROUND RUNNING MS WORD INTRODUCTION

How to create pop-up menus

SellerDeck 2014 Responsive Design Guide

Appendix H: Cascading Style Sheets (CSS)

USER GUIDE. Unit 4: Schoolwires Editor. Chapter 1: Editor

BLACKBOARD 9.1: Text Editor

MICROSOFT OUTLOOK 2010 READ, ORGANIZE, SEND AND RESPONSE S

UNPAN Portal Content Management System (CMS) User Guide

Web Design Revision. AQA AS-Level Computing COMP2. 39 minutes. 39 marks. Page 1 of 17

HTML and CSS. Elliot Davies. April 10th,

Unit 21 - Creating a Button in Macromedia Flash

HTML Templates Guide April 2014

Chapter 14: Links. Types of Links. 1 Chapter 14: Links

MICROSOFT POWERPOINT STEP BY STEP GUIDE

How To Use Dreamweaver With Your Computer Or Your Computer (Or Your Computer) Or Your Phone Or Tablet (Or A Computer)

DREAMWEAVER BASICS. A guide to updating Faculty websites Created by the Advancement & Marketing Unit

Creating Your Personal Website

Making a Web Page with Microsoft Publisher 2003

Using JCPS Online for Websites

Referencing Web links in the Survey Workbench Questionnaire

Dreamweaver Tutorial #1

Terminal Four (T4) Site Manager

Microsoft PowerPoint 2010 Handout

MadCap Software. Import Guide. Flare 11

Google Sites: Site Creation and Home Page Design

Learnem.com. Web Development Course Series. Quickly Learn. Web Design Using HTML. By: Siamak Sarmady

WORDPAD TUTORIAL WINDOWS 7

... Asbru Web Content Management System. Getting Started. Easily & Inexpensively Create, Publish & Manage Your Websites

How To Design A Website For The Decs

Creating Web Pages with Microsoft FrontPage

Application Note. Building a Website Using Dreamweaver without Programming. Nan Xia. MSU ECE 480 Team 5

Introduction to Macromedia Dreamweaver MX

Beginning Dreamweaver Zac Van Note

Garfield Public Schools Fine & Practical Arts Curriculum Web Design

Dreamweaver and Fireworks MX Integration Brian Hogan

Saving work in the CMS Edit an existing page Create a new page Create a side bar section... 4

FETAC Certificate in Multimedia Production. IBaT College Swords. FETAC Certificate in Multimedia Production Web Authoring Dreamweaver 3

Web design 2: creating web pages and site management using Dreamweaver MX

customer community Getting started Visual Editor Guide!

Creating a website using Voice: Beginners Course. Participant course notes

ACE: Dreamweaver CC Exam Guide

Using Style Sheets for Consistency

Create a Simple Website. Intel Easy Steps Intel Corporation All rights reserved.

Joomla Article Advanced Topics: Table Layouts

Step 2 Open Kompozer and establish your site. 1. Open Kompozer from the Start Menu (at the Polytechnic) or from the downloaded program.

CSS. CSS - cascading style sheets CSS - permite separar num documento HTML o conteúdo do estilo. ADI css 1/28

Please select one of the topics below.

Managing your Joomla! 3 Content Management System (CMS) Website Websites For Small Business

Dreamweaver: Managing Your Site and Content. Oxford University Computing Services

Website Builder Documentation

Microsoft Word 2013 Tutorial

Wellesley College Alumnae Association. Volunteer Instructions for Template

Macromedia Dreamweaver Tutorial

Joomla Templates 101 Barb Ackemann

Dreamweaver: Getting Started Website Structure Why is this relevant?

Instructions for Formatting APA Style Papers in Microsoft Word 2010

Mastering the JangoMail EditLive HTML Editor

How To Create A Web Page On A Windows (For Free) With A Notepad) On A Macintosh (For A Freebie) Or Macintosh Web Browser (For Cheap) On Your Computer Or Macbook (

Microsoft Access 2010 handout

CMS Training Manual. A brief overview of your website s content management system (CMS) with screenshots. CMS Manual

Microsoft PowerPoint Exercises 4

Drupal Training Guide

CSS 101. CSS CODE The code in a style sheet is made up of rules of the following types

Dreamweaver. Introduction to Editing Web Pages

Code View User s Guide

Personal Portfolios on Blackboard

Transcription:

Cascading Style Sheets (CSS) for Websites Exercise This exercise assumes you have become familiar with writing HTML and using the common HTML tags. It is recommended that you complete the Formatting With Style exercises in your HTML notes to gain a more complete understanding of CSS as this exercises is only a brief demonstration of how styles work. These exercises will assume you are using the Macromedia HomeSite HTML editor but other editors will work fine. 1. Begin by making sure you have a copy of the CSS exercises in a folder on your computer 1. This folder contains a website which contains basic HTML pages using a table layout. There is no formatting as the formatting will be done entirely using CSS. 2. Open the index.html in your editor and view the existing HTML. 3. Preview the page to see how it looks in a browser. 4. Do the same for the other 4 HTML files. 5. Create a new file in the editor and delete and HTML that is placed in to the new file. It needs to be completely blank. 6. Enter the following line in the style rule blank document P{font-size: 11pt; font-family: Arial, sans-serif; TEXT-ALIGN:justify} 7. Save the file as kalgoorlie.css The line you have entered specifies that the contents of any paragraph tag will be justify aligned with 11 point font size. The font used will be Arial and if the Arial font is not available, a generic sans-serif font will be used instead. Since the first two parts of the style rule both relate to font attributes they can be combined. 8. Change the style rule so that it appears as below. P{FONT:11pt Arial,sans-serif;TEXT-ALIGN:justify} The rule still means the same thing but is written in a simpler way. 1 Available from http://www.oneil.com.au/pc/html/css_files.exe Steve O Neil 2005 Page 1 of 5 http://www.oneil.com.au/pc/

9. Save the file again. Now we need to place a line in the HTML files that will refer to this style rule. 10. Open the index.html file and add the following line in the HEAD section of the document. <LINK HREF="kalgoorlie.css" REL="stylesheet" TYPE="text/css"> The example below shows where the line should be placed. This line tells the web browser to refer to the stylesheet names kalgoorlie.css to see how the document should be formatted. 11. Copy that same line to the same location in the other four HTML files. Now each file will be referring to the same stylesheet for formatting information. This means that we can add or edit style rules in that one location and it will affect all of the documents that refer to it using the LINK tag a great way to set up formatting options for a whole website in one go. 12. Preview any of the files and you will see that any text in a paragraph tag will be using the formatting specified in our stylesheet. Steve O Neil 2005 Page 2 of 5 http://www.oneil.com.au/pc/

Using a Style Editor Homesite (and Macromedia Studio) include a basic version of a CSS editor called Topstyle. You can use this handy editor to modify stylesheets the same way you can use Homesite to modify HTML Documents. If you don t have Topstyle available you can still make the following changes to your CSS file without it. 1. Right-click on the LINK tag in one of your HTML documents and choose the Edit Linked Stylesheet option as shown to the right. This will open the linked stylesheet (kalgoorlie.css) in Topstyle. If this isn t working for some reason, you can open the program from the start menu and then open the file from within Topstyle. 2. Add the following lines below your paragraph style rule. A{COLOR:Blue;FONT:11pt Arial,sans-serif;TEXT-DECORATION:none} A:HOVER{COLOR:Red;TEXT-DECORATION:underline} H2{COLOR:Maroon;FONT:18pt Arial,sans-serif;FONT-WEIGHT:bold;TEXT- ALIGN:center} H3{COLOR:Maroon;FONT:12pt Arial,sans-serif;FONT-WEIGHT:bold} Each of these four lines are explained below The first rule formats anchor tags (links) so that the text is blue, Arial font size 11 and no text decoration (which removes the underline that links usually have). The second rule is for when the mouse hovers over anchors (links). This rule means that when the mouse goes over a link, the link will change to red colour with an underline. The third rule formats level 2 headings so that they are maroon in colour, centre aligned with bold, Arial size 18 font. The fourth rule formats level 3 headings so that they are e maroon in colour with bold, Arial size 12 font. Save the changes in the CSS file you are editing and then preview any one of your HTML documents to see the formatting changes. Note Topstyle can be set as the default style editor for other programs such as Dreamweaver and Frontpage. Steve O Neil 2005 Page 3 of 5 http://www.oneil.com.au/pc/

Style Classes All of the style rules we have created so far specify how a certain tag will be formatted. You can also create style classes that can be used wherever you want, by placing a reference to the class in any tag you want to use it in. We will use a style class to change the formatting of the links in the navigation bar so that the mouse-over formatting will be different from other links. Add the following 2 lines to your CSS file..navbar{color:black;line-height:2} A:HOVER.NAVBAR{BACKGROUND:Black;COLOR:Yellow;TEXT-DECORATION:none} The first of these rules states that any text referring to the NAVBAR class will have black text and double line spacing. The second rule states that any links using the NAVBAR class will change when a mouse passes over them so that the background colour becomes black with yellow text and no background. Now we need to add some information to our HTML so that it refers to the new style class. 3. Open one of your HTML files. We will add a class attribute to one of the anchor tags in the navbar. Find the line that says <TD><A HREF="index.html">Home</A></TD> 4. Change it so that it says <TD><A HREF="index.html" CLASS="navbar">Home</A></TD> This link will now refer to the navbar class in the stylesheet for its formatting. Copy the same attribute to the rest of the links in the navbar as shown below. 5. Make the same changes to the other HTML files. 6. Save and preview the documents. Steve O Neil 2005 Page 4 of 5 http://www.oneil.com.au/pc/

The completed CSS file should look like the following example (it doesn t matter if your rule lines are not in the same order). Steve O Neil 2005 Page 5 of 5 http://www.oneil.com.au/pc/