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

Similar documents
Dreamweaver MX Handout Outline

ITNP43: HTML Lecture 4

Web Design and Development ACS-1809

The internet is a worldwide collection of networks that link millions of computers. These links allow the computers to share and send data.

By completing this practical, the students will learn how to accomplish the following tasks:

Introduction to WEB PROGRAMMING

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

Html basics Course Outline

Cascading Style Sheets Level 2

INTRODUCTION TO CSS. Mohammad Jawad Kadhim

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

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

HTML and CSS: An Introduction

WEBSITE PROJECT 2 PURPOSE: INSTRUCTIONS: REQUIREMENTS:

CSS. Introduction to. Meganadha Reddy K. Technical Trainer NetCom Learning

CSS Cascading Style Sheets

Introduction to Cascading Style Sheet (CSS)

COMS 359: Interactive Media

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

Introduction to using HTML to design webpages

CREATING A WEBSITE USING CSS. Mrs. Procopio CTEC6 MYP1

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

Data Visualization (CIS/DSC 468)

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

CSS Cascading Style Sheets

Activity 4.1: Creating a new Cascading Style Sheet

HTML/XML. HTML Continued Introduction to CSS

Downloads: Google Chrome Browser (Free) - Adobe Brackets (Free) -

Diploma in Mobile App Development Part I

CS 1100: Web Development: Client Side Coding / Fall 2016 Lab 2: More HTML and CSS

CHAPTER 1: GETTING STARTED WITH HTML CREATED BY L. ASMA RIKLI (ADAPTED FROM HTML, CSS, AND DYNAMIC HTML BY CAREY)

Three Ways to Use CSS:

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

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

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

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

How to create and edit a CSS rule

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

Methods for configuring Cascading Style Sheets. Applying style to element name selectors. Style Rule Basics. CMPT 165: Cascading Style Sheets

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

HTML & CSS November 19, 2014

Chapter 7 Typography, Style Sheets, and Color. Mrs. Johnson

What is CSS? NAME: INSERT OPENING GRAPHIC HERE:

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

Introduction to HTML & CSS. Instructor: Beck Johnson Week 2

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

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

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

CSS: The Basics CISC 282 September 20, 2014

Introduction to Multimedia. MMP100 Spring 2016 thiserichagan.com/mmp100

Using CSS in Web Site Design

ICT IGCSE Practical Revision Presentation Web Authoring

Using Dreamweaver CS6

Introduction to HTML and CSS. Arts and Humanities in the Digital Age 2018 CHASE DTP Dr. Paul Gooding

Introduction to HTML

ICT IGCSE Practical Revision Presentation Web Authoring

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

Markup Language SGML: Standard Generalized Markup Language. HyperText Markup Language (HTML) extensible Markup Language (XML) TeX LaTeX

CSS.

Figure 1 Properties panel, HTML mode

CS134 Web Site Design & Development. Quiz1

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

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

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

Skill Area 323: Design and Develop Website. Multimedia and Web Design (MWD)

WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5

GIMP WEB 2.0 MENUS. Before we begin this tutorial let s visually compare a standard navigation bar and a web 2.0 navigation bar.

Using Dreamweaver CS6

CASCADING STYLE SHEETS (CSS) BY: RIHAM ALSMARI, PNU. Lab 4

Styles, Style Sheets, the Box Model and Liquid Layout

Intermediate Web Publishing: Working with Styles

Chapter 3 Attractive Web Designing

CSS: Cascading Style Sheets

Module 2 (VII): CSS [Part 4]

USING STYLESHEETS TO DESIGN A WEB SITE IN DREAMWEAVER MX 2004

Web Publishing Basics I

Dreamweaver CS6. Level 1. Topics Workspaces Basic HTML Basic CSS

Appendix D CSS Properties and Values

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

HTML/CSS. HTML review and extra CSS review CSS Color

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

CSC 121 Computers and Scientific Thinking

AGENDA. HTML CODING YOUR HOMEPAGE [ Part IV ] :: NAVIGATION <nav> :: CSS CODING FOR HOMEPAGE [ <nav> & child elements ] CLASS :: 13.

Reading 2.2 Cascading Style Sheets

HTML & CSS. Lesson 1: HTML Basics Lesson 2: Adding Tables Lesson 3: Intro to CSS Lesson 4: CSS in more detail Lesson 5: Review

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar. Hover Effect:

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

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

CSS: formatting webpages

CSS - Cascading Style Sheets

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

More about HTML. Digging in a little deeper

BASICS OF WEB DESIGN CHAPTER 2 HTML BASICS KEY CONCEPTS

Web Publishing Basics II

HTMLnotesS15.notebook. January 25, 2015

CSS worksheet. JMC 105 Drake University

Cascading style sheets, HTML, DOM and Javascript

Creating and Building Websites

The building block of a CSS stylesheet. A rule consists of a selector and a declaration block (one or more declarations).

Transcription:

CSS Intro Introduction to Cascading Style Sheets What is CSS? CSS (Cascading Style Sheets) is a supplementary extension to allowing web designers to style specific elements on their pages and throughout their site. CSS defines the style of a website--elements like typography, color, spacing, positioning, etc. can be thought of as the content or structure with an organization of elements (tags) and CSS applies the style or formatting. Why use CSS: 1. It has become the standard in web design and development: <font> tags are being eliminated and may not be supported by browsers in the future. 2. Faster loading for your webpages: less code and smaller pages 3. Separation of design from content: ability to control an entire site by only modifying a single file. If you decide later to change the font color of all the menus in the site, it can be done in one easy step. How CSS works: CSS is applied to an existing web document--both working in tandem to display web pages. CSS Web Browser h1 { font-family: Arial; text-align: center; <h1> This is Header 1 text.</h1> <p> This is Paragraph text.</p> style structure webpage

Mechanics of Cascading Style Sheets Dreamweaver 8 CSS : Mechanics CSS is a simple mechanism for controlling the style of a Web document without compromising its structure. (Webmonkey) How to use CSS: CSS can be applied to an document in three different ways. 1. Using an tag - redefine an existing tag, e.g.. Use the existing tags as selectors to define the elements of your site. Hello World! 2. Creating an ID attribute in a tag - create your own selector to define. The created ID can only be used once in a page and typically works with blocks of content (e.g. using a <div> tag to define the navigational nav bar/menu). The pound sign (#) indicates an ID selector in your stylesheet. ID <div id= nav > <ul> <li>menu</li> </ul> 3. Creating a CLASS attribute in a tag - create your own selector to define. The created CLASS can be re-used throughout your document. Let s say you want certain words to be bold and larger on your page--create a CLASS, give it a name, and you can apply it as many times as you like on the same page. The CLASS selector name is preceded by a period (.) in your stylesheet. CLASS <p class= bold > Bold Text </p> CSS body { font-family: Arial; text-align: center; CSS #nav { font-family: Arial; font-size: 0.8em; CSS.bold { font-size: 2.0em; font-weight: bold; Browser Browser Browser DEFINITIONS Elements --> Elements are the specific areas in your web page that you can define with tags. They act like labels that identify and structure the different parts of a web page. Examples: body, paragraph, images, links, sections and areas you define. Tag --> Tags are the principle elements that make up (X) or web pages. They consist of an opening tag (the element s name and attributes, if any) and a closing tag (a forward slash, followed by the element s name) on either side of your content. They are enclosed within <> symbols and they structure and define your content. <p>paragraph Text </p>

CSS How to Apply CSS to your : Dreamweaver 8 CSS : Mechanics 1. LINKED - Linking to an external CSS file (or importing) in the html header is the most commonly used method -- recommended for use in the overall web site. Example of standard syntax for linking to an external style sheet: <link href= mystyle.css rel= stylesheet type= text/css /> <html> <head> <title>linked Example</title> <link href= mystyle.css rel= stylesheet type= text/css /> </head> <p>this is Paragraph text.</p> </html> mystyle.css DEFINITIONS Tag Attribute --> Attributes are contained within the opening tag and provide more information about an element. An attribute also has a value. The value is usually enclosed within quotation marks. <img src= green.jpg /> img is the element, src is an attribute, and green. jpg is the value. 2. EMBEDDED - Use the <style></style> tag embedded in the html header of your document. Used internally for individual web pages. Example of internal style sheet: <style type= text/css > </style> <html> <head> <title>embedded Example</title> <style type= text/css > </style> </head> <p>this is Paragraph text.</p> </html> 3. INLINE - Use the style attribute in any tag locally. Use for specific words, phrases, or paragraphs. It is the least used. CASCADING & OVERRIDING The later your CSS style appears, the more precedence or importance it has. Locally (inline) applied styles have the most precedence and will override any styles applied earlier in your document. Multiple style sheets can be applied to web pages -- this is where the term cascading comes from. Example of applying local style: <p style= font-family:times; text-align:left ></p> <html> <head> <title>inline Example</title> </head> <p style= text-align: left > This is Paragraph text.</p> </html>

CSS : Mechanics CSS Anatomy and Syntax: CSS syntax works in the form of rules (see example below). Rules are composed of selectors and declarations. A CSS declaration has two parts enclosed within an opening and closing curly bracket {: 1. a property (i.e. color ) and 2. a value (i.e. green ) Example of the anatomy of a CSS Rule: Declaration Selector h1 { color: #800080; font-size: 0.8em; font-family: Arial, Helvetica; Property Value DEFINITIONS Selector --> The selector is the element to which the CSS will be applied. It is referenced in the by either a tag or a tag attribute. color: #FF0;, the p is the selector, referencing all paragraph tags in your web site. ADDING COMMENTS TO YOUR STYLE SHEETS It s a useful practice to include comments in your style sheets to help you quickly identify and remind yourself of the different elements or specific areas/pages in your site. You can insert a comment between rules in your style sheet by typing /* to begin you comments and */ to signal the end of your comments. /* applies to the nav bar on home.htm */.redcolor {background:red;font-style:bold

New CSS File New CSS File We recommend setting up a CSS file at the same time a new site is started. Creating a New CSS File from the File Menu: 1. Select File > New... 2. From the General tab (at the top of the window), select Basic Page under the left Category column and CSS in the middle column. Then click Create. 3. Select File > Save. Save the file to your site folder with a.css ending/ extension. Note: You can also select a pre-made CSS Style Sheet (example below). Now all you need to do is attach the new file (see next page).

Attaching a CSS File Attaching a CSS File Style sheets can be attached or linked in Dreaweaver, or attached manually in the header by switching to code view: <link href= mystyle.css rel= stylesheet type= text/css >. New or existing CSS files can be attached. Attaching a CSS File in the CSS Styles Panel: 1. Make sure the document you want to attach to is open and is the active document. 2. Click the Attach Style Sheet button, located at the bottom of the CSS Styles Panel. 3. Click Browse... and navigate to your CSS file. Click Choose. 4. Select Add as a Link. Click OK. Note: You should see your CSS file (and rules) displayed in the CSS Styles Panel. Also, in Code View, take note of the added to your header: <link href= mystyle.css rel= stylesheet type= text/css >

CSS Example Typical Document Structure Using IDs <div id= wrapper > <div id= masthead > <div id= nav > <ul> <li>menu 1</li> <li>menu 2</li> <li>menu 3</li> </ul> <div id= content > <h1>heading 1</h1> <p class= main >Main Content</p> <div id= footer >