dreamweaverCS6 Flipbook PDF

dreamweaverCS6
Author:  p

113 downloads 303 Views 2MB Size

Recommend Stories


Porque. PDF Created with deskpdf PDF Writer - Trial ::
Porque tu hogar empieza desde adentro. www.avilainteriores.com PDF Created with deskPDF PDF Writer - Trial :: http://www.docudesk.com Avila Interi

EMPRESAS HEADHUNTERS CHILE PDF
Get Instant Access to eBook Empresas Headhunters Chile PDF at Our Huge Library EMPRESAS HEADHUNTERS CHILE PDF ==> Download: EMPRESAS HEADHUNTERS CHIL

Story Transcript

Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

Table of Contents Overview ........................................................................................................................ 3 Getting Started............................................................................................................................................... 3 Web Page Creation Tips............................................................................................................................... 3 Creating a Basic Web Page Exercise ......................................................................... 4 Create a New Page ........................................................................................................................................ 4 Using a Table for the Layout ....................................................................................................................... 5 Adding Text ................................................................................................................................................... 6 Adding Images ............................................................................................................................................... 6 Adding Links .................................................................................................................................................. 7 Introduction to Cascading Style Sheets (CSS) ........................................................... 9 Common Formatting Done with CSS ....................................................................................................... 9 How Styles Appear in the Code ................................................................................................................10 Creating a Style........................................................................................................... 11 Editing a Style ..............................................................................................................................................11 Different Types of Styles .............................................................................................. 12 Global Changes – Redefining Tags ..........................................................................................................12 Getting More Specific – Using Classes ....................................................................................................12 Even Greater Specificity – Compound Styles.........................................................................................13 Defining Your Style ...................................................................................................... 14 Type Options ...............................................................................................................................................14 Background Options...................................................................................................................................14 Block Options ..............................................................................................................................................14 Box Options .................................................................................................................................................15 Border Options............................................................................................................................................15 List Options .................................................................................................................................................15 Positioning Options ....................................................................................................................................15 Linking to a Style Sheet............................................................................................... 16 Tag Example Page .......................................................................................... 17 Creating and Defining Tags ........................................................................................................17 Creating More Tags ......................................................................................................................18 Creating a Special Link Style for the Navigation Area...........................................................................18 A Few More Things to Try ........................................................................................................................19 Using Your Tags on Multiple Documents..................................................................................19 Placing Your Pages on the Web ................................................................................ 20 Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 1 of 25

Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

Verifying Your html Folder .......................................................................................................................20 Transferring Files Using mFile ..................................................................................................................21 Saving Directly to Your IFS Space at Some UM Locations .................................................................21 Transferring Files via FTP .........................................................................................................................21 Using a Template That Comes With Dreamweaver ................................................. 22 Creating Dreamweaver Templates ........................................................................... 23 Defining a Site .............................................................................................................................................23 Creating the Template ................................................................................................................................23 Defining the Template’s Editable Regions ..............................................................................................24 To Apply to a Blank Document................................................................................................................25 To an Existing Page ....................................................................................................................................25 Modifying a Template................................................................................................. 25

Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 2 of 25

Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

OVERVIEW Dreamweaver and other web page editors create HTML (HyperText Markup Language) code that controls everything about how the page looks and acts. You create and edit the pages locally (on your computer) – to make them display on the web, you need to transfer them to a web server. You must not only transfer the web page(s) you created, but all images used, other files such as PDFs, and the style sheet if you are using one. You can transfer the files from within Dreamweaver or by using mFile or other file transfer software program. Basic information is covered in the Placing Your Pages on the Web section of this handout. If you have a large website, you might want to create a template, which is discussed on page 23.

GETTING STARTED The most important step in creating your website will be determining your layout. Where will the body text be? What kind of navigation is needed? How many sections or pages do I need? You can just start typing on your Dreamweaver page, but if you want to specify where you want your navigation, main text, etc. you will want to use one of two methods to layout your page: tables or tags. Tables are a little easier for beginners and so we use those in the first exercise, but we’ve included information about using the tags on page 17. To keep your pages consistent (font, size, etc.), you will probably want to use an external cascading style sheet (CSS). A CSS style is a set of formatting attributes (bold, size, font, spacing, etc.) that is applied to an element on the page. More details about style sheets are found on page 9.

WEB PAGE CREATION TIPS • Faculty, students and staff at the University of Michigan, are given space for web pages: http://www-personal.umich.edu/~youruniqname/filename.html • At U of M, you need to put all of your files in the Public/html folder of your IFS in order for them to be seen on the web. • The file name for the main page of any site needs to be called index.html – if it’s not, a list of all the files in that folder will display. • File and folder names should be one word (no spaces), all lower case. • Don’t use special characters in the file name (#, &, periods that aren’t part of the extension). • You need to transfer all files for your site (pages, images, style sheets, PDFs, etc.) to the web, so keep everything in one folder on your computer to make it easier and so links won’t break. • View your pages in different browsers (i.e. Firefox and Internet Explorer) and on different platforms (Windows and Mac) as some things like font size might display slightly differently. • Use standard fonts for your text because fonts have to be installed on the computer viewing the page. If necessary (for banners, buttons, etc.), create a graphic. • Remember to use Alt tags (alternative text tags) for all of your images. Give them meaningful names, such as “Picture of Susan Smith” rather than just “image”. Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 3 of 25

Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

CREATING A BASIC WEB PAGE EXERCISE What we are going to do is create a basic page, and then format the text and so on later. This section covers the basic elements that are part of most web pages: layout, text, images, and links. Later, we’ll use an external style sheet (see page 9) to format your text, links, etc. For this exercise we are going to use a table to layout our page, putting the navigation to our other pages in the left column and our main text (and any images) in the right column. On page 17, we use the alternative method of tags to layout our page.

CREATE A NEW PAGE If the splash screen appears, click HTML in the Create New column. Otherwise, 1. Go to the File menu and select New…. 2. In the left most menu select Blank Page. 3. In the Page Type: column, select HTML. 4. In the Layout: column, select . (While there are a variety of templates you could use to get started on your page, often times these make things more confusing!) 5. Click the Create button and save the file in the folder where you’re going to save all of your web files (this includes images, PDFs, style sheets, etc). Remember that you need all of these files together in order to easily and quickly transfer your entire website to the web. The screen may default to the “Split” view, so you can see the code as well as the design view. To change this, click on the Design icon just above the blank page.

Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 4 of 25

Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

USING A TABLE FOR THE LAYOUT Tables are an extremely powerful web design tool for laying out text and images on a web page. Tables allow you to add vertical and horizontal structure to a page and can contain images, text or any other element. 1. Click on the Table icon ( ) in the Insert Panel (at the right of your screen), or go to the Insert menu and select Table. 2. Set the Rows and Columns, as well as the Table width. If you use percent in the width, your page will contract and expand depending the width of the browser. If you choose pixel, then it will always be that size. 3. Since we’re using the table as a layout tool and don’t want to see the gridlines, put a zero (0) in the Border thickness: field. You’ll see a dotted line between the cells in Dreamweaver, but it won’t appear in a web browser. 4. Leave the rest of the settings at their defaults and click OK. 5. Once the table displays on the page, you can drag the edges between the cells to resize them. In our case, we want the left column (for the navigation) to be narrower than the right. When a table is selected, the Property Inspector at the bottom will have table properties, and you can change things like the number of rows or columns, width, background color, and so on. To select a table, click on the edge of it or choose from the Tag Selector, located just above the Property Inspector. To center the whole table on the page, choose Center from the Align pulldown. CellSpace (cell spacing) changes the space between each cell and CellPad (cell padding) sets the space between the cell content and the cell boundary. MERGING TABLE CELLS In a case like ours (see picture at the top of the previous page), we want our main graphic to span across both columns, so we need to merge the cells together, just like you would in Word or Excel. 1. Highlight both cells by clicking on one, holding the mouse, and dragging towards the other cell until you can see that it is also selected (see top row below).

2. Go to the Modify menu, Table, and then Merge Cells (you could also right-click, then go to Table and Merge Cells from the shortcut menu). We’ll come back in a few minutes and add an image to this merged area. Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 5 of 25

Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

ADDING TEXT Type in text like you would in Microsoft Word or most other programs: • For new paragraphs, press Return/Enter on the keyboard • To get a single line, press Shift+Return/Enter Text will wrap just like it does in Word. For now, avoid changing any of the formatting of the text. Notice that your text is aligning to the middle of the first column – tables default to aligning objects in the middle of the cell. In the Property Inspector you should see some text properties and some table properties. To align the text to the top of the table cell, change the Vertical (Vert) alignment to Top. You’ll need to do this to both table cells. Dreamweaver defaults to the HTML Properties Inspector, which has limited formatting options. For more choices, you have to use Cascading Style Sheets (CSS) – see page 9. ADDING A TITLE The title of the page is what displays in the browser tab or title area (see example). Type in the text you want – this does not display on the page itself.

ADDING IMAGES Images must be .jpg, .gif, or .png file to work properly on the web. All the images you use should be stored in the same folder as the rest of your web files. Unlike Microsoft Word or PowerPoint, Dreamweaver does not embed your images, but rather links to them (even though they display on the page). This means that when moving your pages to the web, you must move the images as well. To insert an image in Dreamweaver, 1. Put your cursor where you want the image and click the Images icon ( ) in the Insert Panel and choose Image or go to the Insert menu and choose Image from the list. (For our example, add one image in the merged cells at the top, and then another in with the text.) 2. Navigate to your image in the dialog box and click Choose (Mac) or OK (PC). 3. When you add the image, the Image Tag Accessibility Attributes dialog box automatically displays. Add some text in the Alternate text: field – this text will display when users move their mouse over the image and is what screen reading software reads. Generally, we suggest you don’t resize your image in Dreamweaver, because the browser still has to load the larger image, and this takes time. You can resize in Photoshop or other graphic editor.

Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 6 of 25

Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

As in Microsoft Word, when you insert an image, Dreamweaver sees it as one large character, so you will probably want to change the wrapping. CHANGING THE IMAGE/TEXT WRAPPING To change how the image is displayed in relation to surrounding text, 1. Make sure that the image is selected. 2. Right-click on the image and select the Align option from the resulting menu, then choose Left or Right. 3. To “drag-and-drop” your image anywhere on the page, try putting it in a tag, as explained on page 17). Once an image is in your document, you can click and drag it to a different location or copy and paste it just as you would text.

ADDING LINKS Keep in mind that sites often change location or disappear all together, so it’s important to check them often to make sure they are still active. There are four types of links that you can create: External: to a page outside of your website Local: to other pages/files in your website Email: to send an email message Anchor: to another location in the same page EXTERNAL AND LOCAL LINKS External links take you to any site on the Internet that is not one of your pages – for example http://www.umich.edu or http://www.Amazon.com. You must include the http:// . Local links take you to another page in your site – these can be .html files, PDFs, images, or any file type. Local links only require the name of the file (e.g. projects.html). To make either of these types of links, 1. Highlight the text or image that will be the link. 2. In the Properties Inspector, type (or paste) the URL in the Link field. If linking to one of your files, click on the folder to the right of the Link field to browse. 3. To make the link appear in a new tab or window, choose _blank from the Target pulldown in the Properties Inspector. 4. Press Return/Enter on the keyboard to create the link. Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 7 of 25

Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

YOUTUBE (OR OTHER) VIDEOS • To link to a YouTube video, go to the page with the video and copy the text in the URL field. Back in Dreamweaver, type in the text you want people to click on, highlight it, and then paste into the Link box. This is an external link, as described above. • To embed a video so it displays on your page, copy the text in the Embed field on the page, go to Dreamweaver, place your cursor where you want it to appear, switch to the Split View and paste. In Dreamweaver, you will only see a gray box; preview in a browser to see how it will look. EMAIL LINKS Email or Mailto links allow someone to click once on a link and send you an email (if they have their computer configured properly). To make a mailto link, 1. Highlight the text or image that will be the link. 2. Click on the Email Link icon ( ) in the Insert Panel. 3. If you’ve highlighted an email address, the Text: and Email: fields will already be filled in; if not type in the correct text and click OK. ANCHOR (INTERNAL) LINKS Anchor links take you to a specific location within a page; it can be on your current page, or a different one within your site. These can be very useful in long pages. Anchor links have two parts: the link itself, and the anchor that it links to. To create an anchor link, 1. Place the cursor on the page where you would like the link to go. In the Insert Panel, click the Named Anchor icon ( ). 2. Give the anchor a one-word description in the Anchor Inspector. 3. Highlight the text on the page that you want to serve as the link. 4. Back in the Properties Inspector, type #name of anchor (the name you used in step 2) into the Link field. (If linking to another page, type the name of the file and then the anchor name. For example, type page2.html#name of anchor.) The anchor itself must have the pound sign (#) before the name.

These are all the basics you need to create a web page. The next pages contain more about formatting to make your pages look more interesting. Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 8 of 25

Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

INTRODUCTION TO CASCADING STYLE SHEETS (CSS) A Cascading Style Sheet style applies a set of formatting attributes (bold, size, font, spacing, etc.) to an element on the page. A Cascading Style Sheet (CSS) is a collection of these styles that can be applied to one or many pages, creating a consistent “look” across your site. In addition to an ID, there are three types of styles: redefinitions of HTML tags, classes, and compound (also known as a selector). Each one has a different purpose, but they all have the same basic options. Dreamweaver calls these options Categories. Within one style sheet, a class style overrides a selector style, which overrides a redefined HTML tag style; your browser gives priority to the tag or class closest to a piece of the document. These levels of priority relate to the “structural” HTML, otherwise understood as the “innermost” style. The “Cascade” in CSS refers to which rules will be applied if there are conflicting instructions for a single element. When instructions do not conflict, all are applied. For example, if the body style specifies blue text, but a particular class specifies Arial, there is no conflict in the instructions and so both will be applied (the text will display as blue and Arial). If however, there is a conflict, the “innermost” style is applied: so, if the body style specifies blue text, but a particular class specifies red, the text in that area would display as red. While you can create pages that contain all of the CSS instruction on the page itself (an internal style sheet), if you have more than one page, you will probably find it easier to put all of the styles on an external style sheet, and then link all of your pages to this sheet. This way, if you change a setting (for example, you want all our text on all the pages to be Arial instead of Times New Roman), you just change it once (in the style sheet); that change will then reflect on all pages. If both internal and external style sheets are applied to a document, the internal style sheet takes precedence. You’ll need to know some basic HTML, and a little more about how CSS works, too.

COMMON FORMATTING DONE WITH CSS For a quick reference, here are some of the common changes people want to make, and which Dreamweaver category to find them in. After we show you how to create a style, we’ll go into each category in a little more detail. Bold: Type category, the Font-weight: pulldown menu. Italic: Type category, the Font-style: pulldown. Remove underline from link: Type category. In the Text-decoration: area, check the none checkbox. You could also use the underline option to add an underline to text. Double spacing: Type category. Set the Line-height: to double of what’s in the Font-size: box.

Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 9 of 25

Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

Background image or color: Background category. For colors, click on the color square; for images, choose it from the Browse… button by the Background-image: box. Set the Backgroundrepeat: option as appropriate (to change the background of the page, redefine the body tag). First line indentation: Block category, set the Text-indent: by pixels or inches. Center/right align text: Block category, set the Text-align: as appropriate. Paragraph indentation: Box category. Uncheck Same for all under Margin. Set the left indent to the appropriate amount and then set the rest to zero. Add a border: Border category. Set the appropriate style, width, and color.

HOW STYLES APPEAR IN THE CODE Depending on what element has the style, you may see a few different things if you look at the HTML code. For example, for redefined tags, it won’t look any different than normal (the tag itself). However, if a tag has a class applied to it, it would appear as something like this:

The first paragraph just has the

tag, which has been redefined to be Arial instead of Times New Roman. The second paragraph has the “red” class applied, and within that paragraph, the word “important” has the “special” class (more about classes below). When you use a class style (as described on page 12) within a sentence, the tag is automatically used to mark the boundaries of what should have that class, so only that word (or words) has those special characteristics (bold, italic, and blue). By itself, a tag does nothing to a section of the document – you have to add styles to make the application of a tag visible. Spans cannot be used to control alignment. At this level of learning, you should never have to manually add a tag – they should just appear automatically. You may also notice that all of the text – even the words in the “red” and “special” classes – is in Arial. This is because neither the “red” nor the “special” classes contradict this command with a different font. This is an example of cascading .

Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 10 of 25

Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

CREATING A STYLE There are two main ways to create styles – using the Properties Inspector at the bottom of the document (with the CSS button pressed) or the CSS Styles Panel – but both take you to the same dialog boxes. This document uses the CSS Styles Panel. The CSS Styles Panel is usually visible but you can access it from the Window menu if it is not. You may want to click on the All tab so you can see all the styles associated with your document. To start a new style for your document, 1. Click on the New Style button ( ) at the bottom of the CSS Styles Panel. 2. You will see the New CSS Rule window (as at lower right.) Choose which type of style you wish to create (see the next few pages for descriptions of each type). 3. To create an external style sheet that you can apply to several documents, choose New Style Sheet File from the Rule Definition: options at the bottom of the dialog box. 4. The first time you define a style in an external style sheet, you will be prompted to save it. Just as with all other files associated with a web page (e.g., images, javascripts), the style sheet file must be in the same folder as everything else. 5. Once you save the CSS file, the Rule Definition dialog box will appear. Make your choices (described on page 14) and click OK to exit. When you make subsequent styles, you will be prompted to save them in the same style sheet you’ve already created.

EDITING A STYLE To change a style once you’ve created it, double-click on it in the CSS Styles Panel (be sure the All tab is active so you can see all the styles associated with your document.). While you can change characteristics of the style in the Properties for “stylename” area of the CSS Styles Panel, we suggest beginners double-click on the style name and open the dialog box to add properties. You never want to have two styles with the same name, so be sure to edit existing styles, rather than create a new one with the same name.

Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 11 of 25

Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

DIFFERENT TYPES OF STYLES As we mentioned earlier, there are three types of styles: redefinitions of HTML tags, classes, and compound. Which type you choose depends on what you are trying to do. Once we describe what each one is, we’ll talk about the various categories of changes you can make.

GLOBAL CHANGES – REDEFINING TAGS When you redefine standard, pre-existing HTML tags, every time the tag is used it will have the new formatting. Here are a few commonly redefined tags: • Background color/image or the font, size and/or color of ALL text: choose the body tag. • Font, size, etc. of all paragraphs: choose the p tag. • Bullet style (including specifying a different image as the bullet): choose the li tag. • Main section heading font color, size, background color, etc.: choose H1, H2, etc. Choose Tag (redefines an HTML element) from the New CSS Rule Selector Type: pulldown menu, and then choose the tag from the Selector Name: menu or type it in.

GETTING MORE SPECIFIC – USING CLASSES Class styles can be used anywhere in an HTML document. Similar to the bold and italic features of Word, these custom styles are only applied when you manually select (highlight) the text or object you wish to adjust. This is different than tag styles, which apply automatically every time that tag is used. Classes are very useful if you want items in different parts of the document to look the same. Some examples: alert text (for example, bold and bright red), the update date at the bottom of every page (for example, smaller, aligned right, and italic), or particular padding on certain images. When you choose Class (can apply to any HTML element) in the New CSS Rule window, you must give your style a one-word name – Dreamweaver will automatically add a period at the beginning. For example, the bold, bright red style suggested above might be called “.alert”. Then select your style options from the Style Definition window – for our example; the text is set to bold and red. To then apply your class style, 1. Highlight text (or an object) on the page. 2. In the Properties Inspector, choose the class name from the Class pulldown. Remember, unlike a redefined HTML tag, class styles Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 12 of 25

Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

only take effect when you specifically apply them.

EVEN GREATER SPECIFICITY – COMPOUND STYLES Dreamweaver CS 6 calls the third type of style compound. These styles are even more specific than classes – in the example at the right, this new style will be only for Heading 2s that occur within the mainbody DIV. They will look different than Heading 2s that occur elsewhere on the page. The other purpose for this type of style is to change how links look – it could be all the links, or a compound style that is only the links in the navigation area, depending on how you specify the style (see lower picture for example). There is an exercise on page 18 to show you how to create links that look different in the navigation area. To make a compound style, 1. Put your cursor on the text or element that you would like to have the style. 2. Go to the CSS Styles Panel and click on New Style ( ). 3. Choose Compound (based on your selection) in the New CSS Rule dialog box. 4. The combination of tags where your cursor is will display in the box; you can choose Less Specific or More Specific if necessary. If you want to change one of the link types, choose it from the Selector Name: pulldown menu. 5. Click OK and move on to select your style options from the Style Definition dialog box.

Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 13 of 25

Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

DEFINING YOUR STYLE No matter which type of style you’ve created, the options are the same. Each Dreamweaver Category is described below.

TYPE OPTIONS In the Type category, you can change • font, font size, weight (bold, normal), style (italic) and variant (small-caps); • line-height, case, color, and underlines (check none if you want remove the underline from a link). and line-through; • combine Font-size and Line-height specified in pixels or points (i.e., 12px Font-size, 24px Line-height) for double-spaced text. You should use standard fonts for your text because fonts have to be installed on the computer viewing the page. While you can add other fonts to the list (at the bottom of the Font-family: pulldown), be careful because the person viewing the page might not have that font. Remember you can always create a graphic for the banner, buttons, etc.

BACKGROUND OPTIONS Set the background color or image for your style in the Background category. Note that in addition to page and table backgrounds, you can also apply background colors to text, too. If you are using a background image, you can set how it repeats on the page. • The Background-repeat: pulldown lets you select no-repeat, repeat, repeat-x (one row of background images) or repeat-y (one column of background images). • Background-attachment:, Background-position(X):, and Background-position (Y): give you even more control for the placement of the image.

BLOCK OPTIONS In the Block category, you can control • spacing between words or letters of your text; • left, right, and center alignment of the whole paragraph or object (textalign controls the position of tables and images as well as text); • text indents. Note that Text-indent: only indents the first line of a paragraph. To indent the whole paragraph, check out the Box Options, below. Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 14 of 25

Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

Box Options In the Box category, change the • indent of the whole paragraph or object; • size of a paragraph by setting the height and width; • Padding (the space between the border of an element and the element content) and Margin (the space around an element) If you add a Border (see below), you can more easily see the difference between Padding and Margin. Note that you can set Padding or Margin the same for all four sides of an object, or you can set an individual value for each side. This means you can set a left margin of 25 pixels to indent your paragraph only along the left side.

BORDER OPTIONS Change the color, style and thickness of the border around your text or object. You can set all sides the same, or change each one individually. Generally width and color are fairly consistent across browsers, but styles other than solid may look a little different depending on the browser.

LIST OPTIONS This category only applies to lists – ,

    or
  • tags – but you can customize the type of bullet (including images) or numbering that is applied to your list.

    POSITIONING OPTIONS Positioning only applies to tags, which are defined with the ID style. If you set the Type: to absolute, you can specify the exact location. In this example, this will always be 150 pixels wide, 100 pixels from the top, and 10 pixels from the left (it also has a Box setting of 5 pixels on the left to move the text away from the edge of the tag).

    Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 15 of 25

    Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

    LINKING TO A STYLE SHEET Once you’ve created an external style sheet, you can link new or existing HTML pages to it. 1. Open the file that needs to be connected to the style sheet. 2. In the CSS Styles Panel, click the Link icon (circled at lower right). 3. In the Attach External Style Sheet dialog box, click the Browse… button and navigate to your style sheet. 4. Make sure the radio button is set to Link:. 5. Click OK, and you should see the style information in the CSS Styles Panel. You may have to click on the plus sign next to the name of your style sheet to see the individual styles.

    For new pages, you can add the link as you create the document or follow the method above. 1. In the New Document dialog box, right above the Create button, there is a Link icon for attaching the style sheet. 2. Click the Link icon, and in the Attach External Style Sheet dialog box, click the Browse… button and navigate to your style sheet. 3. Make sure the radio button is set to Link: and click OK (see picture above). 4. You are now back in the New Document dialog box; click the Create button.

    Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 16 of 25

    Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

    TAG EXAMPLE PAGE Remember that the tag is useful in marking sections of a document as somehow different from the surrounding area such as a single word or phrase that you want to look different from the rest of the text. The tag is much more powerful than the tag. The tag marks a section of the page as logically separate from other areas of the page. Even without any styles applied, the tag breaks up the page. An area of a page marked off by tags is often referred to as a division or a div – we’ll be using div in this document. The best way to understand styles and tags in particular is to start using them. Some stepby-step exercises follow. There are two types of tags. Because the AP tags create internal styles, we will NOT be using them for this exercise.

    CREATING AND DEFINING TAGS We’ve taken some time to sketch out what we’d like our page to look like, and we’ll use tags to accomplish this. We can use other styles to define our headings, links, and so on, and even specify different styles that appear only in a particular tag. 1. In the Insert Panel, click on the Insert Div Tag button ( ). 2. In the Insert Div Tag dialog box, type in topbanner (or whatever you’d like) in the ID: field. Since there is nothing else on the page yet, you can leave Insert: to At insertion point, and you can leave Class: blank. 3. Click on the New CSS Style button and you will be taken to the New CSS Rule dialog box that we have seen before. Notice that the Selector Type: is already set to ID (applies to only one HTML element), and the ID that you typed in is in the Selector Name: field. 4. Click OK to begin defining this tag. 5. Define the text color, background color, etc., if desired; if you are going to put a graphic in this div, you can skip right to the Positioning category. 6. In the Positioning category, set the Position value to absolute so you can specify the exact location on the page. Set the Width: to 700 pixels (or the size of your graphic, or whatever you’d like), and the Top placement to 25 pixels. 7. Click OK, and you will return to the Insert Div Tag dialog box. Click OK again to actually insert the tag. Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 17 of 25

    Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

    CREATING MORE TAGS Repeat these steps for the navigation and mainbody tags. A few things to keep in mind: • When you add more tags, be sure to change the Insert: pulldown to After tag and choose after whichever tag you just did, so they are not nested inside of each other. • For the navigation tag, you might want to set the background color, border and/or fonts to distinguish your navigation from the main body of the page. • You’ll want your navigation and mainbody (or whatever you called them) tags to be the same distance from the top (however far down from your banner). • It is common for the navigation area to be between 150 and 200 pixels, depending on the size of your content. Be sure to put your mainbody tag over to the left the width of your navigation area and a little (if you want some space in between the two). • You’ll want the total width (which you should be able to get from the width and left of your mainbody) to equal the width of your banner if you want all your text to line up under the banner. • To offset the text from the edge of the , go to the Box category, uncheck the Same for all box in the Padding section, and type in 5 to 10 pixels in the Left: box. • Remember, you can edit any style (including these tags) at any time by doubleclicking them in the CSS Styles Panel.

    CREATING A SPECIAL LINK STYLE FOR THE NAVIGATION AREA For this example, want the links in our navigation area to be different from the links on the rest of the page. To change the color (or other properties) for the unvisited and visited links, or rollover (or hover), we edit each one at a time. We’ll start with an unvisited link. 1. Put your cursor on one of the links in the navigation area, and then click to make a new style ( ) in the CSS Styles Panel. 2. Because we have a link inside the navigation selected, the New CSS Rule dialog box defaults to the Selector Type: Compound (based on your selection), and the Selector Name: field says #navigation p a , meaning, all link (a ) elements within paragraphs (p) inside the div called navigation (#navigation ). 3. Since we want to change the color of each type of link, (unvisited, visited, and rollover) we need to specify which type of link. In the Selector Name: field, change the text to #navigation Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 18 of 25

    Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

    a:link . This signifies that we are changing properties only of the unvisited links, but still only

    within the navigation . 4. Click OK to begin editing the link style. In the Type category, change the color as desired. If you don’t want the links underlined, check the none box under Textdecoration. 5. Click the Apply button to see your changes; notice that the changes are only occurring within the navigation . Repeat these steps, using the words “visited” or “hover” instead of “link”.

    A FEW MORE THINGS TO TRY Choose any style you want to play with, and try some of these style properties: • In the Block category, try out some of the interesting text-formatting options like Word-spacing and Text-indent. • In the Border category, select a Style, Width, and Color, remembering that you can set each of these values differently for each of the four sides! Check your page out in a few different browsers to see if it looks the same. • Choose one of your tags and play with the Margin and Padding in the Box category. Remember that the Margin is the space between the div and the rest of the document and the Padding is the space between the edge of the div and the content of the div. • Redefine the body tag to use a background image (in the Background category). Experiment with repeat as well as the horizontal and vertical positioning. • Try creating a style like #mainbody p:first-letter to change the font, color, size, etc. of the first letter of each paragraph of your mainbody. • Check out some of the many CSS online resources, such as http://csszengarden.com/ or http://www.w3schools.com/css/.

    USING YOUR TAGS ON MULTIPLE DOCUMENTS Like any style in your style sheet, once you create a style you can use it in any document. In the next few pages, we’ll create some divs, but to use them on a different page, 1. In the Insert Panel, click on the Insert Div Tag button ( ) (if you don’t see it, make sure you are on Common). 2. In the Insert Div Tag dialog box, choose the appropriate from the ID: pulldown menu. 3. Click OK to exit the dialog box and insert the . Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 19 of 25

    Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

    PLACING YOUR PAGES ON THE WEB In order to view your web page on the Internet, you must place it on a server that is connected to the web. Just as the Information Technology Services’ (ITS) email service lets you access your email from different computers at different locations, the Institutional File System (IFS) lets you access your documents and files in your IFS space from different computers at different locations. IFS is a central file storage, sharing, and retrieval system that you can access from Macintosh, Windows, and Unix computers. At the University of Michigan, students, faculty, and regular staff automatically receive a certain allocation of IFS space. At the University of Michigan - Ann Arbor, the pages you create (and any other associated files) must reside in an html folder in the Public directory of your IFS to be seen via the Internet. By navigating to http://www-personal.umich.edu/~youruniqname/filename.html in a web browser, you can see the website you’ve created. A file called “index.html” is the default main page for your space, or your “homepage”.

    Tips for Easy Transfers Remember, you must transfer not only your HTML files, but also your image files and any other files you are using (such as Flash, CSS, PDFs, etc.) You may find it easier to manage a web site when your files are organized in folders. Use file names that help you to remember the content of the page – do not use spaces or special characters in the file name, and try to keep it short. Browsers can read .htm or .html files – for consistency sake choose one and stay with it.

    VERIFYING YOUR HTML FOLDER Before you can transfer any files to your IFS, you need to verify that there is an html folder. If you have joined the University in the past few years, one may have been created for you. To find out for sure, 1. In any web browser, go to http://mfile.umich.edu and login. 2. Click on the Public folder, and see if you have another folder inside called html. 3. If you do have that html folder, you are ready to transfer files; if not, you need to follow these additional steps: 4. Click on the web sites button towards the top of the screen. 5. Check the box next to the Public site for your uniqname (it should say “uniqname Public” right next to the box). 6. Click the prepare selected web spaces button at the bottom of the list. You are now ready to transfer your files.

    Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 20 of 25

    Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

    TRANSFERRING FILES USING MFILE mFile is a web-based file transfer program. It is somewhat limited (for example, there is a limit of how many files you can transfer at one time, and you can’t upload folders), but it’s much more accessible, being available on any computer with a web browser and an Internet connection. 1. In any web browser, go to http://mfile.umich.edu and login. 2. Click on the Public folder, and then on the html folder. 3. Click the Upload File(s) link on the left side of the page, and follow the instructions.

    SAVING DIRECTLY TO YOUR IFS SPACE AT SOME UM LOCATIONS Note that at some labs on campus, your IFS space is automatically mounted on the desktop of the machine where you’ve logged in. 1. Double-click on the icon for your IFS space. 2. Navigate to the html folder inside the Public folder (note, if the html folder does not exist, don’t make one here! See the Verifying Your html Folder section above). 3. Drag your files (remember to include your image files and styles sheet) into the folder. 4. You can now view your pages at http://www-personal.umich.edu/~youruniqname/filename.html We suggest that you do not edit your pages directly in your IFS space, since if you mess them up, that’s what people will see. Instead, however, we suggest you copy the files to the local machine, edit them, and then move them back into your Public/html folder. This will also work if you have group or class space, but is a little more complicated. Contact [email protected] for assistance.

    TRANSFERRING FILES VIA FTP FTP (File Transfer Protocol) programs open a connection between your computer and the web server computer; U of M requires secure FTP software – Fugu (Mac), Secure Shell (PC), and Dreamweaver’s built-in FTP program are all secure programs. Settings for any of these programs will vary from one computer to the next, but you will always need the address of U of M web servers: sftp.itd.umich.edu . With any of the programs, you will login with your uniqname and Kerberos password. You must then open your Public folder, and inside Public, your html folder. All your web files must reside at or below this level of the folder structure. Remember, if the html folder does not exist, don’t make one here! See the Verifying Your html Folder section above. Once you have established a connection, you should be able to drag-and-drop files from your computer to the server and back. Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 21 of 25

    Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

    USING A TEMPLATE THAT COMES WITH DREAMWEAVER Dreamweaver comes with a variety of templates to get you started. Unfortunately, they can be quite complicated and therefore may be more trouble than they are worth. They all come with styles, and they use divs for the page layout, so make sure you have a good understanding of both concepts before you use the Dreamweaver templates. 1. Go to the File menu and select New…. 2. In the left most menu select Blank Page. 3. In the Page Type: column, select HTML. 4. In the Layout: column, select one of the choices – if you click on one, you will see a preview and a short description. If you choose Link to Existing File from the Layout CSS: pulldown, the divs in the template will still appear on your page, but they won’t be defined (meaning, you will have to reposition them as well as change colors, fonts, etc. – see left picture below). If you choose Add to Head, then they display the way you think they will, but you end up with internal and external style sheets, with some conflicting information (see right picture below). Since the purpose of using a template in the first place it to have the positioning set, we suggest you choose Add to Head, and see the last step below. 1. Click the Link icon, and in the Attach External Style Sheet dialog box, click the Browse… button and navigate to your style sheet. 2. Make sure the radio button is set to Link: and click OK (see picture on page 16). 3. You are now back in the New Document dialog box; click the Create button. 4. In the CSS Styles Panel, drag the styles you want from the second, internal style sheet into your main style sheet, and delete the ones you don’t want. So, in the example below, I would drag all of the styles but the body up to the mystyles.css, and the delete the one called body in the style style sheet.

    Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 22 of 25

    Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

    CREATING DREAMWEAVER TEMPLATES You can also create your own template – with it you can set certain areas to remain constant (uneditable) and other areas so that they can be changed (editable). For example, you may want to have navigation images/links to your main sections consistently appear in the left margin of every page. A template would allow you to “lock in” the links or navigational images, but let’s you edit the content for an individual page. Sample Template File

    Page Based on the Template

    DEFINING A SITE To use a template on your website, you first need to define the site, telling Dreamweaver where the local files are. 1. Go to the Site menu and select New Site…. 2. In the Site Setup dialog box, give your site a name in the Site Name: field. This is how Dreamweaver identifies the site you’re about to define and it does not show up on your web page anywhere. 3. Click on the folder icon at the end of the Local Site Folder: field and navigate to an existing folder (if you have one) or create a new folder in the subsequent dialog box. If you are not using Dreamweaver’s built-in FTP feature, click on the Save button.

    CREATING THE TEMPLATE

    1. Go to the File menu and select New…. 2. In the left most menu select Blank Template. 3. In the Page Type: column, select HTML Template. 4. In the Layout: column, select . (The other templates are discussed in the section above).

    Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 23 of 25

    Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

    5. If you already have a CSS created, click the Link icon, and in the Attach External Style Sheet dialog box, click the Browse… button and navigate to your style sheet. Make sure the radio button is set to Link: and click OK. 6. Click the Create button. 7. Before you start adding text and so on, you’ll want to save your page. Go to the File menu and choose Save. Because this is a template and you haven’t added any editable areas yet, you will get an error message. That’s ok, because after we save it, we’ll go back and add the editable regions. 8. In the Save As Template dialog box, you will see the name you’ve given your site in the Site: field. Any existing templates will be listed in the Existing Templates: field. In the Save As: field, type a name for your template. If your web site is going to have several sections (and therefore several templates), give it a name that easily identifies it for you. 9. Once you’ve given it a name, click on Save. Dreamweaver automatically creates a Templates folder for you (if there wasn’t one) in your site, and you’ll note that the name of your file has the extension .dwt for Dreamweaver Template. Create the table or tags that you are using to layout your page, and create/edit your style sheet as needed. Add any images, text and formatting you would like to have on multiple pages, such as navigation links or images, page background color, and so on. This also includes title text that will be the same across pages. You should keep in mind at least one area where you plan to insert text, pictures, or other objects on each individual page.

    DEFINING THE TEMPLATE’S EDITABLE REGIONS Now that you have a template with the basic layout, you need to mark certain areas as editable (that can be changed on an individual page). Every other part will remain uneditable. 1. With the template still open, put your cursor in the area you want to be able to edit on other pages. In the Insert Panel menu, choose Templates, then Editable Region. 2. Give the new attribute a name, such as “mainbody” or something that will help you remember which area is which, then click OK. The new editable region name will appear in blue and the same text will appear below it. This text can be deleted either here in the template, or on each page as you create it. You can also type in your own sample text (see sample on previous page) with the formatting you want. The editable region expands automatically as you add content, so don’t worry about the region being too small. From now on when you save this file, a dialog box will ask if you want to update documents based on this template. Generally speaking, you’ll always want to click Yes. Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 24 of 25

    Creating Web Pages with Dreamweaver CS 6 and CSS A University of Michigan Library Instructional Technology Workshop

    APPLYING THE TEMPLATE TO A NEW DOCUMENT Once you have created your template, you can create new documents based on the template or attach the template to existing pages. Make sure your template is saved, and then close it. 1. Go to the File menu and select New…. 2. In the left most menu select Page from Template. 3. Your site name displays in the Site: column, and any templates you have will be in the Templates for Site “Name” third column. Choose the appropriate template, and you’ll see a preview in the last column. 4. Click the Create button. 5. The page will look exactly like the template, but you can only work within the editable region outlined in blue (the name of the region will display at the top of the area, just like it does in the template). Click inside one of the editable regions to begin creating the content for this page.

    APPLYING THE TEMPLATE TO AN EXISTING PAGE If you already have a page to which you’d like to apply the template, open the page, then go to the Modify menu, choose Templates, and select Apply Template to Page… Click once on the correct template and then click on the Select button. Since you already have text, graphics, etc. in your document, the Inconsistent Region Names dialog box will appear. Choose the appropriate region to put your content in and click OK. Orphaned content can only be placed in one editable region, so if you have multiple editable regions, you may need to do some cutting and pasting on your page to get everything back the way you want it.

    MODIFYING A TEMPLATE

    Before applying the template

    After applying the template

    When you make a change to a template and save it, Dreamweaver will prompt you with a dialog box asking if you’d like to update pages that are based on this template. Click Yes so the pages are updated to reflect the changes in your template. If you modify the template while a page is open that uses the template, the change will occur automatically on the non-template page, but you will be prompted to save. Need help? Visit the Faculty Exploratory or Knowledge Navigation Center on the 2nd floor of the Graduate Library. [email protected] | http://guides.lib.umich.edu | [email protected] rev: 10/16/12 25 of 25

    Get in touch

    Social

    © Copyright 2013 - 2024 MYDOKUMENT.COM - All rights reserved.