Using Dreamweaver CS6

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

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

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

Using Dreamweaver CS6

Using Dreamweaver CS6

Before you begin, make sure you have the images for these exercises saved in the location where you intend to create the Nuklear Family Website.

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

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

CSS worksheet. JMC 105 Drake University

DAY 4. Coding External Style Sheets

Using Dreamweaver CS6

How to lay out a web page with CSS

Using Dreamweaver. 3 Basic Page Editing. Planning. Viewing Different Design Styles

Using Dreamweaver CC. 5 More Page Editing. Bulleted and Numbered Lists

Using Dreamweaver. 5 More Page Editing. Bulleted and Numbered Lists

Using Dreamweaver CC. 3 Basic Page Editing. Planning. Viewing Different Design Styles

Figure 1 Properties panel, HTML mode

CSS Cascading Style Sheets

Eng 110, Spring Week 03 Lab02- Dreamwaver Session

FRONTPAGE STEP BY STEP GUIDE

CSS exercise - Part 1

Taking Fireworks Template and Applying it to Dreamweaver

Cascading Style Sheets (CSS)

ORB Education Quality Teaching Resources

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

Bold, Italic and Underline formatting.

ICT IGCSE Practical Revision Presentation Web Authoring

Dreamweaver 8. Project 5. Templates and Style Sheets

CSS: The Basics CISC 282 September 20, 2014

Activity 4.1: Creating a new Cascading Style Sheet

Book III. Working Like the Pros

Lab Introduction to Cascading Style Sheets

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

How to create and edit a CSS rule

Reading 2.2 Cascading Style Sheets

CS Multimedia and Communications REMEMBER TO BRING YOUR MEMORY STICK TO EVERY LAB!

Project 1: Creating a Web Site from Scratch. Skills and Tools: Use Expression Web tools to create a Web site

Getting Started with Eric Meyer's CSS Sculptor 1.0

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

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

Creating a Website: Advanced Dreamweaver

Using Microsoft Word. Paragraph Formatting. Displaying Hidden Characters

AGENDA :: MULTIMEDIA TOOLS :: (1382) :: CLASS NOTES

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

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

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

CSS cont. October 5, Unit 4

Session 4. Style Sheets (CSS) Reading & References. A reference containing tables of CSS properties

Dear Candidate, Thank you, Adobe Education

Creating a Navigation Bar with a Rollover Effect

ICT IGCSE Practical Revision Presentation Web Authoring

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

Dreamweaver MX Overview. Maintaining a Web Site

Using Microsoft Excel

Lab 4 CSS CISC1600, Spring 2012

Introduction to Web Tech and Programming

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

Dreamweaver MX The Basics

Animation and style sheets

Class 3 Page 1. Using DW tools to learn CSS. Intro to Web Design using Dreamweaver (VBUS 010) Instructor: Robert Lee

HTML/XML. HTML Continued Introduction to CSS

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

Unit 10 - Client Side Customisation of Web Pages. Week 5 Lesson 1 CSS - Selectors

Building Your Website

Assignments (4) Assessment as per Schedule (2)

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

CREATING A WEBSITE USING CSS. Mrs. Procopio CTEC6 MYP1

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

Introduction to using HTML to design webpages

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

Dreamweaver CS3 Lab 2

Introduction to WEB PROGRAMMING

CSS: Formatting Text. CSS for text processing: font-family. Robert A. Fulkerson

How to Control and Override CSS by Including a CSS Link

Table Basics. The structure of an table

Three Ways to Use CSS:

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

Fundamentals of Web Technologies. Agenda: HTML Links 5/22/2017. HTML Links - Hyperlinks HTML Lists

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

CSS.

**Method 3** By attaching a style sheet to your web page, and then placing all your styles in that new style sheet.

In this project, you ll learn how to create a webpage for your favourite recipe.

Fish Eye Menu DMXzone.com Fish Eye Menu Manual

Using Microsoft Excel

Using Dreamweaver 2 HTML

Using Dreamweaver CS6

Web Publishing Basics II

Dreamweaver Basics Outline

CSE 154 LECTURE 3: MORE CSS

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

Using Microsoft Word. Text Editing

How to use CSS text styles

Overview of the Adobe Dreamweaver CS5 workspace

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

Using CSS in Web Site Design

Lesson 1 HTML Basics. The Creative Computer Lab. creativecomputerlab.com

Dreamweaver CS5 Lab 2

How to lay out a web page with CSS

Creating and Building Websites

Web Development & Design Foundations with HTML5

Transcription:

6 So far we have used CSS to arrange the elements on our web page. We have also used CSS for some limited formatting. In this section we will take full advantage of using CSS to format our web site. Just to recap on some of the advantages of using CSS: More precise control than HTML alone can provide over layout, fonts, colours, backgrounds, and other typographical effects. A way to update the appearance and formatting of an unlimited number of pages by changing just one document. Increased compatibility across browsers and platforms. Less code, smaller pages, and faster downloads. And remember that CSS can be used several ways in a website. 1. Linked or Imported Stylesheets 2. Embedded Styles 3. Inline Styles The reason Cascading Stylesheets have cascade in the name is that Style rules defined in one place can cascade through all the pages in your website. If you have style rules using the same name in different parts of your site, your web browser will choose which one to use based on where they were defined. I.e. an inline style (defined for one element in a page) will over-rule an embedded style (defined for a whole page). An embedded style will over-rule a linked style (defined for a whole site). E.g. if you have an inline style saying a particular H1 tag is green but the embedded style says H1 tags on that page are brown, then in that particular case the heading will be green. Exercise 1 Additional Style Selectors Make sure one of your HTML files is open. It doesn t matter which one, as long as it is linked to your CSS file (any of the ones created using your template should be suitable). 1) Check the Code view. In the Code view there will be a line near the top of the page like the following. In the HTML it will look grey as it is part of the template. <link href="styles.css" rel="stylesheet" type="text/css" /> This tells the web browser that CSS rules in the file styles.css should be applied to this page. Our index page currently isn t linked to the CSS file we ve created. 2) Open index.html. 3) Click the Attach Style Sheet icon at the bottom of the CSS Rules panel. Steve O Neil 2014 Page 1 of 10 http://www.oneil.com.au/pc/

4) Click the Browse button so that you can select your styles.css file and click OK. 5) Open one of your other files in the website. 6) Click on the styles.css file within the CSS Styles panel to select it. 7) Click the Edit Style Sheet icon at the bottom of the panel. 8) You will see the CSS code for all of the existing style rules. Have a look through them to familiarise yourself with the style rules and how they are written. 9) Return to Design view. 10) Click the New CSS Rule button in the CSS Rules panel to create a new style rule within the CSS file. 11) Set the Selector type to Tag with the Selector Name to P as shown. Make sure the Rule Definition is set to save in style.css and click OK. This will create a rule affecting all of the paragraph text in the website. Steve O Neil 2014 Page 2 of 10 http://www.oneil.com.au/pc/

12) Make sure Type is selected from the list of categories on the left. 13) Click on the Font-family list. You will notice that your options are limited. For the sake of simplicity, Dreamweaver usually only shows a selection of the most commonly used fonts in websites. If you would like to use a font that doesn t appear in the list, choose the Edit Font List option. 14) Scroll through the list of Available fonts until you find Comic Sans MS (yeah a lot of people don t like Comic Sans but Francie likes it!). Select Comic Sans MS and click the button to add it to your list of Chosen fonts. 15) You can also specify alternate fonts in case someone looking at your website doesn t have the font you specify. Add Arial (a more common font) and then add sans-serif (a generic font name for any font like Arial that doesn t have serifs in other words, no curly bits at the top and bottom of letters the way this text you re reading does). Generic fonts are usually at the bottom of the list. 16) When the options look like the example below, click OK. 17) Now choose your new font selection ( ) from the Fonts list. 18) For the other type options, set the font size to 11 with Points as the unit of measurement and enter navy for the colour. You can type in the boxes if the option you want isn t listed. The completed options should look like the example on the following page. Steve O Neil 2014 Page 3 of 10 http://www.oneil.com.au/pc/

19) Click OK when the options have been selected. Make sure you choose pt for font-size instead of px. You will see the changes in each of your documents. The changes only affect the paragraph text in the documents. Some other types of text such as text in table cells (in HTML s TD tags) and text in lists (in HTML s LI tags) will not have that formatting. We can easily modify the CSS file to group together a few selectors. 20) Open the styles.css file. Change the P selector so that it also includes a selector for LI and TD tags with a comma between each one as shown in the example below. 21) Save the changes to the CSS file and return to Design view. The text in tables, bulleted lists and numbered lists in the other documents will now be updated with information from the CSS file. 22) Select body from the list of styles in the CSS Rules panel and click the Edit Rule button. (you can also double-click the name of the style in the list to edit it) 23) Select Background from the Category list. 24) For Background image enter back.jpg. 25) Click OK when done to apply the changes. 26) Click on the New CSS Rule icon in the CSS Styles panel. We will create a new CSS rule for the cells in our table that will align their contents to the top instead of the middle. Table cells are created with the TD (table data) tag as you will see if you check the HTML for any page where we ve used a table. 27) Choose Tag for the Selector Type, TD for the Selector Name and styles.css for the Rule Definition and click OK. 28) Select the Block category and set the vertical-align property to top. 29) Click OK to apply the changes. All the tables in your website should now have the contents of cells aligned to the top of the cell instead of the middle. This will be most noticeable in the gallery.html page. 30) Create your own new rule that specifies how table headings (TH tag) will look. You will see this change on the gallery.html page. Steve O Neil 2014 Page 4 of 10 http://www.oneil.com.au/pc/

Exercise 2 Creating CSS Classes 1) Click on the New CSS Rule icon in the CSS Styles panel. 2) For Selector Type choose class and make sure Rule Definition in is set to styles.css. 3) Enter.francie for the class name (class names must begin with a full stop). 4) Click OK to create the new style rule. 5) In the Type category, select a dark green colour for the text. 6) In the Background category, choose a light green colour for the Background Colour. 7) Click OK to finish adding the new style rule. 8) Open about.html. 9) Select the text Francie's Flowerpots at the beginning of the first paragraph. 10) From the Properties panel, select.francie from the Targeted Rule list. The selected text will be formatted according to the new style class you created. 11) Apply the new style class to other pages of the website where the name of the business appears. Exercise 3 Editing a Style Any style can be edited and any changes made to a style will be seen in parts of the website that use the changed style. We ll change the new style class to see how the changes update through the site. 1) Double-click the.francie class in the CSS Styles panel. Steve O Neil 2014 Page 5 of 10 http://www.oneil.com.au/pc/

2) Change the text colour to a dark brown and click OK. Any parts of your website using that class will now change. Exercise 4 Inline Styles Sometimes you may want to change some formatting in a specific part of a document in a way that doesn t need to apply elsewhere in a site. This is where you can use inline styles. Inline styles only apply to a particular tag and will over-ride any style rules for that tag that may have come from elsewhere. E.g. you might have a stylesheet with a rule that says all headings are brown but you might want to make an exception by using an inline style to make one particular heading a different colour. Some of what you have done in dreamweaver has already created some inline styles. 1) Open the about.html page. 2) Select the last sentence that says We're certain that we have just the right pot for you. 3) In the Properties Panel, select the CSS category. 4) Change the Targeted Rule option to New Inline Style. 5) Using the other options in the properties panel change the size to 12pt and change the font and colour to options of your own choosing. 6) Dreamweaver will create a CSS rule which applies only to that bit of text. 7) Check in your code view. You will notice that the text has been surrounded by a <span> tag. That span tag contains a style= attribute which includes the CSS rule with your font changes. A style tag like this could be placed in any tag but since there was no tag already around that specific bit of text a span tag (which pretty much serves as a container for purposes like this) was used. Steve O Neil 2014 Page 6 of 10 http://www.oneil.com.au/pc/

Exercise 5 Creating Styles for Hyperlinks The CSS specification includes a few style classes that are reserved especially for hyperlinks (the A or anchor tag). The a:link class allows you to create style rules for regular hyperlinks (usually blue). The a:visited class allows you to create style rules for hyperlinks that point to a location the user has already visited (usually purple by default). The a:active class allows you to create rules for hyperlinks that are active, or links that have been clicked (usually red while the browser waits for the next page to start appearing). The a:hover class allows you to create rules for hyperlinks that have a user s mouse hovering over them. 1) Open any of the HTML documents in your site. 2) From the CSS Styles panel, click the New CSS Style icon. 3) Choose Compound for Selector Type and then choose a:link for the selector. Make sure Define in is set to style.css. 4) Click OK to create the new style rule. 5) Set font Decoration to none (so the links won t have the usual underline) and the Color to blue. 6) Click OK to create the new style rule. 7) From the CSS Styles panel, click the New CSS Style icon. 8) Create similar classes for a:visited (with the colour changed to purple) and a:active (with the colour changed to red. Each one should still have text-decoration set to none. 9) Create a new class and choose Compound for Selector Type. Choose a:hover for the selector. Make sure Define in is set to style.css. 10) In the Type category, set the Color to red with the Decoration set to underline and overline. 11) In the Background category, set a light yellow for the background colour. 12) Click OK to finish creation of the new style rule. Steve O Neil 2014 Page 7 of 10 http://www.oneil.com.au/pc/

13) From the File menu select Save All to make sure all documents including the CSS file are saved. 14) Preview one of the HTML documents in your web browser. Move your mouse over the links to test them (they all have links along the bottom you can test and some pages have other links also). 15) Open the site_styles.css file to see the style rules that have been created. Dreamweaver has some tools that enable you to see how certain types of styles would look from within the editor. 16) Right-click anywhere along the toolbar at the top of the Design view. 17) Click Style Rendering to turn on that toolbar. There is a row of icons which will tell Dreamweaver to show your links the way they would look with certain classes applied. 18) Click the icon to have your links showing the way they would look when a mouse is hovering over them. 19) Click the icon to return your links to their normal look. 20) Right-click the toolbar to turn the toolbar off (unless you d rather leave it showing). Dynamic HTML DHTML or Dynamic HTML is a combination of HTML, CSS and scripting such as Javascript, that are used to make web pages more interactive. Later exercises will make use of Dreamweaver s DHTML features to create some advanced web site navigation tools but for now we ll use it for a more simple effect. We re going to use DHTML to change the images in the navigation bar when the mouse moves over them. In each link on the navigation bar, we will set things up so that when a mouse goes over the image, it is replaced with a modified version of the image. When the mouse goes away from the link, the original image will be restored. This will result in a simple mouse over effect. Exercise 6 Creating a DHTML Mouse Over Effect 1) Since we re going to be modifying the navigation bar, we ll need to open the template for editing so open Main Pages.dwt. 2) Click on the first linked image in the navigation bar (Home). 3) Before we assign any behaviours to this image, it would be useful to give it a name, otherwise it will be referred to as something generic like image1. In the Properties Panel, enter img_home as the ID of the selected image. Note The object name for the image is not the same as the filename. The Object name identifies the part of the page where the image appears so that it can be referred to from elsewhere. The filename identifies which image file is to appear in that position. Steve O Neil 2014 Page 8 of 10 http://www.oneil.com.au/pc/

4) Click on the heading for the Tag Inspector Panel and then click the Behaviours tab. If that panel is not visible, you can select Behaviours from the Window menu or press [Shift] [F4]. 5) With the Home image still selected, click the Add Behaviour icon + in the Behaviours Panel. 6) A list of available behaviours will appear. From the list select Swap Image. 7) From the list of images select nav_home. You will notice that the other images don t have names. We ll give them each a name before assigning a behaviour to them. 8) Make sure the Preload Images and Restore Images onmouseout options are ticked. 9) Click the Browse button and select the image nav_home_act.gif. Note Giving each of your files clear names like this makes it easy to tell what s what. In this case, images in the navbar all start with nav. Images used for actions have the same name as the normal images with act added to the end of the names. 10) Click OK to add the behaviour. A second behaviour restoring the original image will also be added for when the mouse goes off the image. 11) Create similar behaviours for each of the other links in the navbar. Make sure you assign an appropriate name for each image (such as img_about) before you create a behaviour. 12) Once you have created MouseOver behaviours for each of the link images, save the changes to the template. Make sure each of the files based on the template is updated. 13) Close the template. Steve O Neil 2014 Page 9 of 10 http://www.oneil.com.au/pc/

14) Open and preview one of the site s HTML documents in your web browser. Test the links. Steve O Neil 2014 Page 10 of 10 http://www.oneil.com.au/pc/