Internet/Web Page Development I

Similar documents
ITNP43: HTML Lecture 4

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

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

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

Web Design with CSS and CSS3. Dr. Jan Stelovsky

Chapter 7 Page Layout Basics Key Concepts. Copyright 2013 Terry Ann Morris, Ed.D

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

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

ICE: HTML, CSS, and Validation

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

JJY s Joomla 1.5 Template Design Tutorial:

CSS for Page Layout. Key Concepts

Using Style Sheets for Consistency

Outline of CSS: Cascading Style Sheets

Interactive Data Visualization for the Web Scott Murray

Web Design and Databases WD: Class 7: HTML and CSS Part 3

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

Web Developer Jr - Newbie Course

CHAPTER 10. When you complete this chapter, you will be able to:

Further web design: Cascading Style Sheets Practical workbook

Essential HTML & CSS for WordPress. Mark Raymond Luminys, Inc mraymond@luminys.com

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

Introduction to Web Development

Microsoft Expression Web Quickstart Guide

Introduction to Adobe Dreamweaver CC

Development Perspective: DIV and CSS HTML layout. Web Design. Lesson 2. Development Perspective: DIV/CSS

Web Authoring CSS. Module Descriptor

Web Design and Development ACS Chapter 9. Page Structure

CREATING HORIZONTAL NAVIGATION BAR USING ADOBE DREAMWEAVER CS5

CSS - Cascading Style Sheets

How to code, test, and validate a web page

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

Garfield Public Schools Fine & Practical Arts Curriculum Web Design

HTML CSS Basic Structure. HTML Structure [Source Code] CSS Structure [Cascading Styles] DIV or ID Tags and Classes. The BOX MODEL

Creating Web Pages with Dreamweaver CS 6 and CSS

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 (

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

HTML and CSS. Elliot Davies. April 10th,

EUROPEAN COMPUTER DRIVING LICENCE / INTERNATIONAL COMPUTER DRIVING LICENCE WEB EDITING

Responsive Web Design for Teachers. Exercise: Building a Responsive Page with the Fluid Grid Layout Feature

Designing HTML s for Use in the Advanced Editor

Create Webpages using HTML and CSS

BLACKBOARD 9.1: Text Editor

Web layout guidelines for daughter sites of Scotland s Environment

Introduction to web development and JavaScript

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

What is CSS? Official W3C standard for controlling presentation Style sheets rely on underlying markup structure

Create a Poster Using Publisher

WEB DEVELOPMENT IA & IB (893 & 894)

Web Development CSE2WD Final Examination June (a) Which organisation is primarily responsible for HTML, CSS and DOM standards?

Basic tutorial for Dreamweaver CS5

Advanced Online Media Dr. Cindy Royal Texas State University - San Marcos School of Journalism and Mass Communication

Fast track to HTML & CSS 101 (Web Design)

Level 1 - Clients and Markup

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Cascading Style Sheet (CSS) Tutorial Using Notepad. Step by step instructions with full color screen shots

ART 379 Web Design. HTML, XHTML & CSS: Introduction, 1-2

Kentico CMS, 2011 Kentico Software. Contents. Mobile Development using Kentico CMS 6 2 Exploring the Mobile Environment 1

Course Information Course Number: IWT 1229 Course Name: Web Development and Design Foundation

Flare Tips and Tricks. Tips and tricks. Importing content Lists. Variables and snippets Condition tags Printed documentation WebHelp.

HTML, CSS, XML, and XSL

RESPONSIVE DESIGN BY COMMUNIGATOR

Web Design for Print Designers WEB DESIGN FOR PRINT DESIGNERS: WEEK 6

Cascading Style Sheets (CSS)

Web Development I & II*

ebooks: Exporting EPUB files from Adobe InDesign

Creating a Resume Webpage with

IE Class Web Design Curriculum

Building Your Website

CST 150 Web Design and Development I Midterm Exam Study Questions Chapters 1-3

CIS 467/602-01: Data Visualization

HTML5 and CSS3 Part 1: Using HTML and CSS to Create a Website Layout

Лваполо. Customization

Web Design and Development Program (WDD)

Last week we talked about creating your own tags: div tags and span tags. A div tag goes around other tags, e.g.,:

Introduction to Web Technologies

LAB MANUAL CS (22): Web Technology

USD WEB SERVICES ADOBE DREAMWEAVER CSS DEVELOPMENT

Coding HTML Tips, Tricks and Best Practices

Graphic Design Basics. Shannon B. Neely. Pacific Northwest National Laboratory Graphics and Multimedia Design Group

Learning Web Design. Third Edition. A Beginner's Guide to (X)HTML, Style Sheets, and Web Graphics. Jennifer Niederst Robbins

Microsoft Word 2011: Create a Table of Contents

Web Design & Development - Tutorial 04

The Essential Guide to HTML Design

WordPress and HTML Basics

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

Marketing 101 Maximizing Results

Base template development guide

COMMONWEALTH OF PENNSYLVANIA DEPARTMENT S OF Human Services, INSURANCE, AND AGING

What is a Web Browser? Web Site Functionality. A client program that uses HTTP to communicate with web servers.

Creating a PowerPoint Poster using Windows

Simply download Beepip from and run the file when it arrives at your computer.

Selectors in Action LESSON 3

A send-a-friend application with ASP Smart Mailer

The Essential Guide to HTML Design

SUBJECT CODE : 4074 PERIODS/WEEK : 4 PERIODS/ SEMESTER : 72 CREDIT : 4 TIME SCHEDULE UNIT TOPIC PERIODS 1. INTERNET FUNDAMENTALS & HTML Test 1

ANDROID TRAINING COURSE MODULES. Module-I: Introduction to Android. Introducing Android. Installing Development Tools. Using the Emulator.

Using Adobe Dreamweaver CS4 (10.0)

BlueHornet Whitepaper

Responsive Web Design: Media Types/Media Queries/Fluid Images

Transcription:

Internet/Web Page Development I HTML/CSS Tutorial Four Internal Cascading Style Sheets Introduction Estimated time for completion: 2 hours Tutorial Topics Cascading Style Sheets You have been using inline styles, which seem to be incredibly cumbersome. The thought of having to do all that typing or copying and pasting throughout every document of a Web site is daunting. The use of internal CSS will make the task much easier. This exercise will cover the following concepts: Cascading Style Sheets Using inline CSS Using document CSS (also called embedded ) Combining inline and document CSS Class styles By using style sheets in HTML documents on the Web, authors can influence the presentation of documents without sacrificing device-independence or adding new HTML tags. CSS has various levels and profiles. Roughly speaking, desktop browsers implement level 1, 2, or 3. Other programs implement the appropriate profile for their platform cell phones, PDAs, televisions, printers, speech synthesizers. CSS Level 1 (1996, 1999) contains properties for fonts, margins, colors, etc., that nearly all profiles of CSS need. CSS Level 2 revision 1 ( CSS 2.1 ) contains all of CSS Level 1 and adds absolutely positioned elements, automatic numbering, page breaks, right to left text and other things. As of June 2005, CSS 2.1 remains a Candidate W3C Recommendation. CSS Level 3 is under development as of June 2005. It includes all of Level 2 and extends it with new selectors, fancy borders and backgrounds, vertical text, user interaction, speech and much more. CSS Mobile Profile 1.0 is for devices such as mobile phones and PDAs. CSS Print Profile is still a draft. It is aimed at low-cost printers. CSS TV Profile 1.0 is for browsers that run on television sets. For the purposes of this course, we will focus on CSS Levels 1 and 2, which apply to Web browsers. Prepared by Paul Roberts (BLH edit) Copyright 2008 by Digital Communication Department. All Rights Reserved

Using inline CSS Up to this point you have been using inline CSS. Writing style code repeatedly for each paragraph <p> element as well as all other elements can be time consuming and tedious. However, the method is extremely powerful in terms of giving the designer control over how the Web site will look. As a reminder of inline styles, let's change the color of the <h2> element to dark green on both pages that we already have written. Open the index.html file and place your cursor in the <h2> tag. Make the following change: <h1> Bridges of the American West</h1> <hr /> <h2 style="color: darkgreen;">welcome to Bridges of the American West</h2> <p style="margin-left: 24px; margin-right: 24px;"> Now open the site_map.html file and make the same change. Load the index.html file into the browser and ensure that the secondary headline is green on both pages. This is an example of inline styles. Throughout this course, you will see the use of three ways of applying CSS to a Web site. The more specific the usage, the higher its priority in the pecking order. Here are the first two usage levels. We will cover the third one in a later tutorial. Inline This is placed as a property in specific tags, as you have already done. You can use the style property, the class property or the id property. This level has highest priority in cases where styles are defined from other levels. Document (or Embedded) This is nested within the <head> element by using the <style> element. Style definitions of various elements apply automatically throughout the document. Inline style definitions override those set in the document level. If you need to change an element style for certain instances of an element, you can either redefine it in a style property or apply a class style that you define in the style sheet. Using document (embedded) CSS Rather than placing the same style definition repeatedly in each instance of an element, let's put the definitions in the <head> element. Open the index.html file and remove all style definitions as follows: <html> <head> <title>bridges of the American West</title> </head> HTML/CSS Tutorial Four Internal Cascading Style Sheets (BLH edit) Page 2

<body style="background-image: url(images/beige011.jpg); margin: 36px;"> <body style="background-image: url(images/beige011.jpg); margin: 36px;"> <h1> Bridges of the American West</h1> <hr /> <h2 style="color: darkgreen;">welcome to Bridges of the American West</h2> <p style="margin-left: 24px; margin-right: 24px;">The American West is a rugged region covered with mountains, canyons, rivers, ravines. Perhaps more than other regions of the American landscape, the West posed problems for settlers as they attempted to traverse its varied terrain.</p> <p style="margin-left: 24px; margin-right: 24px;">Applying the best in human imagination and scientific knowledge, engineers have developed a vast network of highways and bridges to enable the easy movement of goods and travelers from coast to coast. This Web project tells about a few bridges of the western United States and the contributions they have made in the taming of the Wild West.</p> <p style="margin-left: 24px; margin-right: 24px;"><a href="html/site_map.html">site Map</a></p> </body> </html> Combining inline and document CSS Reload the file in your browser to ensure that no styles apply. Do the same thing with the site_map.html file. Use the browser to make sure no styles apply. Go to the index.html file and add a <style> element to the head. Declare the element, following it with a curly brace ({). Then list the properties and values in the same way you did inline. End each element with a curly brace (}). Here is how to do it: <html> <head> <title>bridges of the American West</title> <style type="text/css"> body { background-image: url(images/beige011.jpg); margin: 36px;} HTML/CSS Tutorial Four Internal Cascading Style Sheets (BLH edit) Page 3

h2 { color: darkgreen;} p { margin-left: 24px; margin-right: 24px;} ul { list-style-type: square;} </style> </head> Reload the page in the browser to see that the styles apply once again. Repeat the same procedure for the site_map.html file. You can accomplish it by copying the entire <style> element from the index.html file and pasting into the <head> element of the site_map.html file. Since the site_map.html file is in a different location than the index.html file (relative to the images folder), you will need to change the address to the background image so the browser knows where to find it. Check that file in the browser to see that the style reapplies. If it doesn't work, return to the code and debug it. You will notice the bullets in all the lists are squares. You want the nested lists to display circle bullets. You can override the document style by placing a style property in the <ul> tag of each nested list, like this: <ul style="list-style-type: circle;"> Class styles Try it in the first nested list under "Nature s Bridges" to see what happens. As you see, the inline style overrides the document style because the more local the style, the higher the priority. You could do the same thing in each of the nested lists, but that could become time consuming, especially if you decided to change the style of the bullet. Let's add a class style in the document style element, then call the class in the <ul> tags of each nested list. You begin a class style with a dot or period (.) character. Give it any name you want. It is advisable that you give it a name that will make sense. In this case, we will call it nested. The code looks like this: HTML/CSS Tutorial Four Internal Cascading Style Sheets (BLH edit) Page 4

<style type="text/css"> body { background-image: url(images/beige011.jpg); background-color: beige; font-family: arial, sans-serif; margin: 36px; } h2 {color: darkgreen;} p {margin-left: 24px; margin-right: 24px;} ul {list-style-type: square;}.nested {list-style-type: circle;} </style> Now move to the second nested list under Ancient/Medieval Bridges and call the class, using the class property in the <ul> tag. Here's the example: <ul class="nested"> Check the file in the browser. The first two nested listed should display circle bullets, if you did it correctly. If not, find the errors and make the corrections. Just for kicks, return to the class style definition in the head <style> element. Change the list-style-type from circle to disc. Save the file and reload it. Examine the browser result in the first two nested lists. Note that the first nested list remained a circle while the second one changed to a solid disc. This illustrates the convenience of using class styles inline rather than defining a style with the style property. Go back to the first nested list and change the <ul> code to match that of the second nested list. Also change the list-style-type value back to circle in the definition of the nested class style. Both of the first two nested lists should display circles. Call the nested class into each of the nested <ul> elements on the site_map.html page. Check your results against the following example. They should look the same. Assignment http://swc2.hccs.edu/proberts/html/tutorials/tut_04/html/site_map.html Complete the tutorial exercise on your local computer. Upload the files in their appropriate folders to your FTP site then email the URL to the exercise's home page (index.html) to your instructor with the message that you have completed the work. HTML/CSS Tutorial Four Internal Cascading Style Sheets (BLH edit) Page 5