Introduction to CSS. 2 Sep 13. Derek Peacock. An introduction to defining CSS style rules using tags, classes and ids.

Similar documents
Styles, Style Sheets, the Box Model and Liquid Layout

Using Dreamweaver. 6 Styles in Websites. 1. Linked or Imported Stylesheets. 2. Embedded Styles. 3. Inline Styles

Block & Inline Elements

Dreamweaver Basics Outline

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links

How to lay out a web page with CSS

GIMP WEB 2.0 MENUS WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR CREATING AN HTML LIST

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar with Dynamic Background Image

Using Dreamweaver CS6

Page Layout Using Tables

CSS: The Basics CISC 282 September 20, 2014

Creating your first website Part 4: Formatting your page with CSS

Taking Fireworks Template and Applying it to Dreamweaver

CSS: formatting webpages

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

CSS.

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

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

Introducing Cascading Style Sheets. Cascading Style Sheet Basics Creating Styles Using Styles Manipulating Styles Text Formatting with CSS

Using Dreamweaver CS6

Introduction to WEB PROGRAMMING

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

ICT IGCSE Practical Revision Presentation Web Authoring

ADOBE 9A Adobe Dreamweaver CS4 ACE.

Introduction to using HTML to design webpages

Page Layout. 4.1 Styling Page Sections 4.2 Introduction to Layout 4.3 Floating Elements 4.4 Sizing and Positioning

Guidelines for doing the short exercises

ICT IGCSE Practical Revision Presentation Web Authoring

Creating Forms. Starting the Page. another way of applying a template to a page.

Hands On: Dreamweaver CS3 NEW SPRY Widgets

Appendix D CSS Properties and Values

Creating a Navigation Bar with a Rollover Effect

Creating a Website with Dreamweaver 4

How to set up a local root folder and site structure

COMS 359: Interactive Media

Table of Contents. MySource Matrix Content Types Manual

Nauticom NetEditor: A How-to Guide

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

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


Creating and Building Websites

ORB Education Quality Teaching Resources

Microsoft Expression Web Quickstart Guide

HTML and CSS COURSE SYLLABUS

CSS Selectors. element selectors. .class selectors. #id selectors

HTML + CSS. ScottyLabs WDW. Overview HTML Tags CSS Properties Resources

Dreamweaver Basics. Planning your website Organize site structure Plan site design & navigation Gather your assets

Layout with Layers and CSS

TUTORIAL MADCAP FLARE Tripane and PDF

Deccansoft Software Services

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

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

Dreamweaver CS3 Lab 2

Assignments (4) Assessment as per Schedule (2)

1. Setup a root folder for the website 2. Create a wireframe 3. Add content 4. Create hyperlinks between pages and to external websites

CSS Cascading Style Sheets

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

Web Design and Development Tutorial 03

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

Lab Introduction to Cascading Style Sheets

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

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 3 Introduction to CSS

COMSC-031 Web We S ite Site Development Development- Part 2 Part-Time Instructor: Joenil Mistal November 7, 2013

Dreamweaver: Web Forms

Cascading Style Sheets (CSS)

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

THE HITCHHIKERS GUIDE TO HTML

Dear Candidate, Thank you, Adobe Education

Designing the Home Page and Creating Additional Pages

COMP519 Web Programming Lecture 7: Cascading Style Sheets: Part 3 Handouts

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

Eng 110, Spring Week 03 Lab02- Dreamwaver Session

FRONTPAGE STEP BY STEP GUIDE

Dreamweaver 8. Project 5. Templates and Style Sheets

Cascading Style Sheets Level 2

Networks and Web for Health Informatics (HINF 6220) Tutorial 8 : CSS. 8 Oct 2015

ITNP43: HTML Lecture 4

ABOUT CSS Class Styles... 13

Create a Web Page with Spry Navigation Bar. March 30, 2010

Zen Garden. CSS Zen Garden

A Dreamweaver Tutorial. Contents Page

EDITOR GUIDE. Button Functions:...2 Inserting Text...4 Inserting Pictures...4 Inserting Tables...8 Inserting Styles...9

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

READSPEAKER ENTERPRISE HIGHLIGHTING 2.5

CSS is applied to an existing HTML web document--both working in tandem to display web pages.

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

Dreamweaver CS5 Lab 2

AGENDA. EMBEDDING FONTS [ Font Files & CSS font-family ] :: Online Font Converter :: ADD font-family css code to style.css

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

Chapter 1 Introduction to Dreamweaver CS3 1. About Dreamweaver CS3 Interface...4. Creating New Webpages...10

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

Client Interview. Interview Topics. Goals and Target Audience. Activity 3.1 Worksheet. Client Name:

Activity 4.1: Creating a new Cascading Style Sheet

[Type text] Quick Start Guide Version 3

Web Information System Design No.4 Put Style to Web Documents. Tatsuya Hagino

Lesson 1 using Dreamweaver CS3. To get started on your web page select the link below and copy (Save Picture As) the images to your image folder.

Recipes4Success. Create a Storybook. ImageBlender 2.5 Storybook Maker

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

Which is why we ll now be learning how to write in CSS (or cascading sheet style)

Transcription:

An introduction to defining CSS style rules using tags, classes and ids. 1

The HTML file contains the raw content of a web page, and the css style sheet should control all the design and look of a web page. The two parts of a web page should be kept as separate as possible, so that designers can alter the look of a page without affecting its content. Other people can supply and alter the content without affecting the look of the page. 2

A CSS rule consists of a selector which is used to define which parts of the page will be affected. The rule itself consists of aone or more properties each of which has specfiic values, such as foreground font colour being set to red for all. 3

Best practice is to ensure that an HTML page contains no style information at all. If it does it can not be changed easily by making a change in a single place in a style sheet, and seeing that change ripple through hundreds of web pages instantly. The only exception would be applying bold (as <strong>) and italics as <em> to specific pieces of text. 4

Using HTML tags to define new css rules is the most important as they affect all pages in the web site. Only apply styling to an HTML tag that is likely to apply to most of the pages in the site. For example most pages should have the same outer background colour and the same font and font size for the most of the paragraph text. In this case a style has been applied to the body of the page, as the body contains everything on the page, then this style applies to all the page 5

6

Backgrounds can either be solid colour or can be an image which is displayed whole or repeated to form a pattern. Whenever an image is used it is better to have a background colour as well in case the image fails to load. 7

Block styles are most often used to align text, or to change the display mode from block to inline 8

Box is one of the most widely used categories as it is used to add padding inside a box element such as section, as well as adding margin outside the element. Padding and margin can be individually set for top, left, right and bottom by un ticking same for all. The size of the box and whether the element floats or not can also be set here. 9

The container has been set to be 960px wide, with aset background colour and margins which are automatically calculated. The end result is that the container will be cantered in whatever element it is inside of (usually the body) The dot before the selector name indicates that this selector is a class selector and not an HTML tag selector. However this is not a good example of defining a class. Why?? 10

The class can be used on any HTML tag, in this case the <div> tag. As there is usually only the one container for a page, container would be better defined as an id based selector (see next page). Note the class name in HTML has no dot preceding the name 11

ID selectors are unique names and the are identified in CSS by starting with a # symbol. An HTML page can only have one instance of that id. 12

ID selectors are used in an HTML page by giving the tag an id attribute as shown above. Only one can be used per html page. Again the # symbol preceding the name is only used in css not html 13

The best practice is to store all the css rules in an external css file, and then attach that style sheet to whichever pages need it. This can be done from the CSS Styles panel on the right hand side of Dreamweaver, or in code view by dragging the file from the files panel into the code at the correct place. The correct place is in the <head> of the html page. 14

The easiest way to attach or link a style sheet is to click on the Attach Style Sheet icon in the CSS Styles panel. The style sheet can then be found using browse. The style sheet should be in a separate folder called css, styles, or stylesheets inside the web site. 15

Styles can be defined for multiple selectors. So for example defining a font that will be used for all the headings is shown above, that is then followed by specific sizes for each heading alone. 16

In some cases such as the <a> hyperlink tag, the tag name can be followed by a pseudo class name such as hover, to indicate the style to be applied when the mouse is hovering over the element. 17

Paragraphs for example can have different styles when they are inside sections, or articles. The order the rules are applied is important. The last applied has priority What colour will paragraphs be inside and article inside a section?? 18

Selecting an appropriate set of colours for a web sight is quite difficult. The choice depends upon the intended mood. The web sites above offer a way of selecting a set of colours which complement each other based around a selected main colour. There is a choice of scheme type, depending on how many different colours you want to use in your site, and the overall effect. The chosen scheme can be exported as an html + css page for future reference. 19

20

To get some idea what the chosen scheme might look like there is a preview facility where a Light Page or a Dark Page can be viewed as shown above. 21