Activity 4.1: Creating a new Cascading Style Sheet

Similar documents
How to create and edit a CSS rule

How to lay out a web page with CSS

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

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

Figure 1 Properties panel, HTML mode

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

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

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

CSS: The Basics CISC 282 September 20, 2014

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

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

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

Using CSS in Web Site Design

Using Dreamweaver CS6

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

Dear Candidate, Thank you, Adobe Education

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

How to lay out a web page with CSS

Three Ways to Use CSS:

Table of Contents Chapter 9. Working with Cascading Style Sheets ... 1

ICT IGCSE Practical Revision Presentation Web Authoring

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

How to use CSS text styles

Creating a Website: Advanced Dreamweaver

ACA Dreamweaver Exam Notes

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

Multimedia for the Web: Creating Digital Excitement. Multimedia Element Text

USING STYLESHEETS TO DESIGN A WEB SITE IN DREAMWEAVER MX 2004

Web Development & Design Foundations with HTML5, 8 th Edition Instructor Materials Chapter 3 Test Bank

Page Layout Using Tables

Taking Fireworks Template and Applying it to Dreamweaver

Dreamweaver CS5 Lab 2

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

Book III. Working Like the Pros

How to Create Accessible Word (2016) Documents

Dreamweaver Domain 5: Organizing Content by Using Dreamweaver CS5

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

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

Dreamweaver 8. Project 5. Templates and Style Sheets

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference

Dreamweaver MX The Basics

Web Development & Design Foundations with HTML5

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

Layout with Layers and CSS

Web Development & Design Foundations with HTML5

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

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

Dreamweaver Basics Outline

WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5

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

CSc 337 LECTURE 3: CSS

CSS means Cascading Style Sheets. It is used to style HTML documents.

ICT IGCSE Practical Revision Presentation Web Authoring

CSE 154 LECTURE 3: MORE CSS

Recipes4Success. Create a Storybook. ImageBlender 2.5 Storybook Maker

Appendix D CSS Properties and Values

Dreamweaver CS3 Lab 2

KillTest *KIJGT 3WCNKV[ $GVVGT 5GTXKEG Q&A NZZV ]]] QORRZKYZ IUS =K ULLKX LXKK [VJGZK YKX\OIK LUX UTK _KGX

Html basics Course Outline

Creating consistent content pages

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

Zen Garden. CSS Zen Garden

Web Page Creation Part I. CS27101 Introduction to Web Interface Design Prof. Angela Guercio

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

Creating and Building Websites

Controlling Appearance the Old Way

Web Publishing Basics II

Faculty of Engineering Department of Computer Engineering. CSS Tutorial. Eng. Ahmed J. Alajrami

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

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

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

Lesson 5 Introduction to Cascading Style Sheets

DAY 4. Coding External Style Sheets

Introduction. Format Text. Word 2010 Formatting Text. To Change the Font Size: Page 1

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

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

Microsoft Expression Web Quickstart Guide

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.

Chapter 12: FORMATTING TEXT

Getting Started with Eric Meyer's CSS Sculptor 1.0

Web Design and Development ACS-1809

Lesson 2 Working with Text Using CSS Styles and HTML

Using Dreamweaver to Create Page Layouts

Introduction to Web Tech and Programming

CSS. Lecture 16 COMPSCI 111/111G SS 2018

ADOBE VISUAL COMMUNICATION USING DREAMWEAVER CS5 Curriculum/Certification Mapping in MyGraphicsLab

COSC 2206 Internet Tools. CSS Cascading Style Sheets

CSS for Styling CS380

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

Cascading Style Sheets (CSS)

INTRODUCTION TO CSS. Mohammad Jawad Kadhim

Eng 110, Spring Week 03 Lab02- Dreamwaver Session

Dreamweaver Basics Workshop

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

ITNP43: HTML Lecture 4

FrontPage 2003 Lesson 4 - Creating Individual Pages. Adding a Page Using a Template. Web Page Title. Saving a Web Page

CSS Lecture 16 COMPSCI 111/111G SS 2018

Lab Introduction to Cascading Style Sheets

CSS.

Transcription:

UNIVERSITY OF BAHRAIN COLLEGE OF APPLIED STUDIES LAB 4 Understanding & Creating Cascading Style Sheets (CSS) Description: Cascading style sheets (CSS) are collections of formatting rules that control the appearance of content on a web page. By using style sheets, you can achieve greater consistency across your website (even if your site consists of only one page). CSS styles provide you with a wide range of options for formatting text. After completing these activities you ll be able to create, edit and attach cascading style sheet to your document. Activity 4.1: Creating a new Cascading Style Sheet There are two way to define CSS styles in Dreamweaver, the most basic way is to apply formatting by using the CSS options in the Property inspector, the other way is to use the CSS Styles panel. Creating CSS using property inspector 1. Start Dreamweaver. 2. Create a new HTML document. 3. Save and name the Dreamweaver document as Lab4.html. 4. Type the following text into the document Welcome to University of Bahrain. 5. Select the text. 6. In the property inspector, click CSS to change to the CSS formatting options (Figure 1). Figure 1: Property inspector Done by, Fatima Alhawaj Page 1

7. Display the Font menu in the Property inspector (Figure 2), and select a font group. The New CSS Rule dialog box appears (Figure 3). 8. Display the Selector Type menu, and select Class (Can Apply To Any HTML Element) (Figure 4). Figure 2: Font menu in the Property inspector Note that there are three main types of CSS : Class style: Similar to the styles you use in word processing and page layout programs. For example, you may want to format all body text in 10-point, Arial, dark green type. You can create a Class style with these attributes and then apply this style to all body text in your website. Tag style: Applies global formatting to individual HTML tags rather than to individual selections. Suppose you want to modify the Heading 1 paragraph style to appear always in purple text. Instead of creating a class style and applying it to every heading in the document, you can create an HTML Tag style with these attributes and apply it to the Heading 1 <h1> tag. In effect, you are redefining the HTML tag. Figure 3: New CSS Rule dialog box Figure 4: Selector type menu ID style: A unique identifier (ID) for a style applied to headers, banners, menus, and other elements present in only one location in the document. Used once within a document or page. Done by, Fatima Alhawaj Page 2

9. Click in the Selector Name box and type.mystyle (Figure 5). Note: CSS rules must begin with a period and cannot contain spaces or special characters. 10. Display the Rule Definition menu, and select (This Document Only) (Figure 6). This tells Dreamweaver to create and store the CSS (style sheet) in the current document only. The new style will not be available for use in other documents. To create a CSS for your entire website, you would choose (New Style Sheet File). 11. Click OK. The new font is applied to the first paragraph. The name of the style appears in the Targeted rule box in the Property inspector. 12. In the Property inspector, change the size to 24. 13. Click the Color box in the Property inspector and select a new color for the text. The Property inspector shows the targeted rule (.mystyle) and its formatting (Figure 7). The targeted rule is applied to the first paragraph (Figure 8). You can use this CSS rule to format additional text in your document. Figure 5: Selector Name Figure 6: Rule Definition Figure 7: Targeted rule in the property inspector Figure 8: Formatted text Done by, Fatima Alhawaj Page 3

Creating CSS using CSS Styles Panel Use the CSS Styles panel to create, view, apply, or edit CSS styles for elements of a web page In the All mode, the panel has two panes: All Rules and Properties (Figure 9). Select a style to apply to the selected text in your document or to examine and edit the rules for that style. Show Category View: View the properties of a style rule by property category. Show List View: View an alphabetical list of possible properties and those that compose the selected style rule. Show Only Set Properties: View a list of properties that compose the selected style rule. Figure 9: CSS Styles Panel (All mode) Unlink CSS Stylesheet/ Delete CSS Rule: Unlink the selected style sheet from the document or remove a rule from a style sheet. When you unlink style sheets and delete rules, all the formatting associated with the style sheet or rule is removed. Edit Style Sheet/Edit Rule: Make changes to the selected style sheet linked to the document or to the selected style. New CSS Rule: Create a new style rule. Attach Style Sheet: Attach an external style sheet to your current document. In the Current mode, the panel has three panes: Summary For Selection, About, and Properties (Figure 10). The Summary For Selection pane displays the CSS properties for the current selection in the document. The About pane displays the location of the selected property. The Properties pane allows you to edit the rule s properties and add new properties. Figure 10: CSS Styles Panel (Current mode) Done by, Fatima Alhawaj Page 4

1. Type the text College of Applied Studies in the document. Make sure that no formatting is applied to the text (Figure 11). 2. Make sure the CSS Styles panel is open. If it is not, select Window > CSS Styles. Figure 11: Text with no formatting applied 3. To create a new style, click the New CSS Rule button (+) at the bottom of the panel. The New CSS Rule dialog box opens (Figure 12). 4. In the Selector Type pop-up menu, select Class. 5. In the Selector Name box, type the name Style2 for the style. 6. In the Rule Definition pop-up menu, select This Document Only or New Style Sheet File. 7. Click OK. The CSS Rule Definition dialog box opens (Figure 13). Figure 12: New CSS Rule dialog box Figure 13: CSS Rule Definition dialog box showing type options Done by, Fatima Alhawaj Page 5

8. Select the options for Type, such as the following : Select Arial, Helvetica, Sansserif in the Font-family pop-up menu. Select 18 from the Size-size pop-up menu. Click the color box and select a color in the Color Picker. Select Bold from the Fontweight pop-up menu. Click ok. The CSS Rule Definition dialog box closes. 9. Select the document text. 10. Make sure the Property inspector is open and the HTML option is selected. In Windows, the Property inspector is docked at the bottom of the screen. If the Property inspector is not open, select Window > Properties. 11. Select Style2, or the name of your style, from the Class pop-up menu (Figure 14). Observe that the format of the text has changed (Figure 15). Figure 14: Text Property inspector Figure 15: Formatting applied to text Done by, Fatima Alhawaj Page 6

Activity 4.2: Edit and Delete Cascading Style Sheet You can easily edit and delete CSS using CSSA panel or properties inspector. Edit Styles 1. To view a style sheet s rules, click the plus symbol beside the style sheet you want to edit in the CSS Styles panel. 2. Dreamweaver displays style sheet s rules. 3. Select the rule Style2. 4. At the bottom of the CSS Styles panel, click the Edit Rule button (Figure 16). The CSS Rule Definition dialog box for the selected style opens (Figure 17). You can also edit the CSS rule by clicking the edit rule button in the CSS options in properties inspector. Figure 16: CSS Style panel 5. Choose Background Backgroundcolor, select the color you want. 6. Click Apply then Ok. The CSS rule changed as in (Figure 18). Figure 17: CSS Rule Definition dialog box Figure 18: The document after editing the CSS rule Done by, Fatima Alhawaj Page 7

Delete Styles 1. In the CSS Styles panel under All, select <style>. 2. Click the Delete Embedded Stylesheet button (Figure 19). Dreamweaver removes the internal style sheet. Figure 19: CSS Styles panel In-Class Exercise: 1. Start Dreamweaver 2. Click HTML to create a new document 3. Add the text as shown in (Figure 20) to the document. Figure 20 Done by, Fatima Alhawaj Page 8

4. Create a new CSS Rule for the title Smartphone, name it Style1 with the following formatting: Font-Family Lucida Console, Monaco, monospace Font-size 36 Font-style Italic Color blue Text-decoration underline Alignment Centre 5. Create a new CSS Rule for the first paragraph, name it Style2 with the following formatting: Font-Family Georgia, Times New Roman, Times, serif Font-size 18 Alignment Justify 6. Create a new CSS Rule for the title Most common mobile operating system, name it Style3 with the following formatting: Font-Family Lucida Console, Monaco, monospace Font-size 24 Color Blue Font-weight Bold Text-decoration underline 7. Select the rest of the text. Apply Style2 Make it unordered list. 8. Change the background color to pink 9. Save the document with the name ex4.html 10. Preview the document in browser (Figure 21). Figure 21: Document after formatting Done by, Fatima Alhawaj Page 9