creating a page layout With the index.htm and recipe.htm pages you created, you got some hands-on practice creating different kinds of design elements.

Slides:



Advertisements
Similar presentations
Use Tables for Layout Control Day 7. You will learn to: Understand Tables Create a Simple Table Modify Your Tables Appearance Create Page Layouts with.
Advertisements

Chapter 3 – Web Design Tables & Page Layout
Internet Services and Web Authoring (CSET 226) Lecture # 5 HyperText Markup Language (HTML) 1.
KompoZer. This is what KompoZer will look like with a blank document open. As you can see, there are a lot of icons for beginning users. But don't be.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem External Style.
Html: getting started HTML is hyper text markup language. It is what web browsers look at on the Internet. HTML documents should be created in a simple.
Unit 3 Day 4 FOCS – Web Design. No Journal Entry.
Cascading Style Sheets
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
Chapter 8 Creating Style Sheets.
Web Page Development Identify elements of a Web Page Start Notepad
4.01 Cascading Style Sheets
Creating Tables in a Web Site Using an External Style Sheet HTML5 & CSS 7 th Edition.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
Review HTML  What is HTML?  HTML is a language for describing web pages.  HTML stands for Hyper Text Markup Language  HTML is not a programming language,
Creating Tables in a Web Site Using an External Style Sheet
Creating a Simple Page: HTML Overview
HTML REVIEW.
JQuery Page Slider. Our goal is to get to the functionality of the Panic Coda web site.Panic Coda web site.
Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Website Development with Dreamweaver.
HTML, Third Edition--Illustrated Introductory 1 HTML, Third Edition Illustrated Introductory Unit F Working with Tables.
HTML Comprehensive Concepts and Techniques Second Edition Project 3 Creating Tables in a Web Site.
CO1552 – Web Application Development Lists, Special Characters, and Tables.
Web Technologies Website Development Trade & Industrial Education
Liquid vs. Fixed Layouts Your sample.htm file contains some code and content that you could reuse on every page in a multipage website. If you open sample.html.
Bare bones notes. Suggested organization for main folder. REQUIRED organization for the 115 folder.
Website Development with Dreamweaver
Learning Web Design: Chapter 4. HTML  Hypertext Markup Language (HTML)  Uses tags to tell the browser the start and end of a certain kind of formatting.
IDs versus Classes Naming Your Tags for Maximum Functionality.
More Basic HTML. Add spacing (single & double space) Save Refresh Add horizontal rule Add comments Add styles Add headings Add features Add alignments.
Introduction To CSS.. HTML Review What is HTML used for? Give some examples of formatting tags in HTML? HTML is the most widely used language on the Web.
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
15.2 More Basic HTML. More Basic HTML Add spacing (single & double space) Save Refresh Add horizontal rule Add comments Add styles Add headings Add features.
 A style sheet is a single page of formatting instructions that can control the appearance of many HTML pages at once.  If style sheets accomplished.
CIS 205—Web Design & Development Dreamweaver Chapter 5 Using HTML Tables to Lay Out a Page.
INTRODUCTION TO CSS. OBJECTIVES: D EFINE WHAT CSS IS. K NOW THE HISTORY OF CSS. K NOW THE REASON WHY CSS IS USED. CSS SYNTAX. CSS ID AND CLASS.
Bare bones slide show. The format is text files, with.htm or.html extension. Hard returns, tabs, and extra spaces are ignored. DO NOT use spaces in file.
XP New Perspectives on Microsoft Word 2002 Tutorial 31 Microsoft Word 2002 Tutorial 3 – Creating a Multiple-Page Report.
Unit 3 Day 6 FOCS – Web Design. Journal Unit #3 Entry #4 Write the source code that would make the following display on a rendered page: Shopping List.
Essentials of HTML Class 4 Instructor: Jeanne Hart
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
IT Introduction to Website Development Welcome!
Unit 3 Day 3 FOCS – Web Design. Journal Unit #3 Entry #2 What are (all of) the required tags in a html document? (hint: it’s everything that is in sample.html)
CHAPTER 5 Working with Data Tables and Inline Frames.
DIV, Span, CSS.
HTML GUIDE Press F5 and then Click on the links on the left to get to the section you want Section 1: Getting Started Section 2: Moving Banner Section.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 8: Working with Style Sheets.
Updated on: September 4, 2010 CIS67 Foundations for Creating Web Pages Professor Al Fichera.
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
Positioning Objects with CSS and Tables
HTML Review * is used as a reference for most of the notes in this powerpoint.
Coding with HTML {. THE BASICS { What is HTML and how can you use it to make websites?
CSS IS A LANGUAGE DESIGNED TO TARGET HTML ELEMENTS AND NODES BY TYPE, CLASS, ID AND VALUE, AND CHANGE THEIR VALUES CSS – change how your HTML looks and.
CREATING MASTER PAGES Creating a Master Page Using Master Pages Giving your site a professional look and feel Adding Master Page content to existing pages.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, we’ll cover:  Brief CSS review  Creating sections with the tag  Creating inline.
Introduction to HTML Dave Edsall IAGenWeb County Coordinator’s Conference June 30, 2007.
Revised June 2008 Online PD Basic HTML1 Let’s Try It!  Open Notepad oStart > All Programs > Accessories > Notepad oDon’t get WordPad by mistake – won’t.
Cascading Style Sheets for layout
INTRO TO WEB DEVELOPMENT html
4.01 Cascading Style Sheets
Bare boned notes.
Bare bones notes.
Cascading Style Sheets (Layout)
Tutorial 3 – Creating a Multiple-Page Report
Bare bones notes.
4.01 Cascading Style Sheets
Presentation transcript:

creating a page layout With the index.htm and recipe.htm pages you created, you got some hands-on practice creating different kinds of design elements using HTML tags and CSS. And while they're perfectly acceptable as Web pages, most websites actually use a layout that makes it easy to recognize what site you're in—and easy to get from one page to the next within the site (assuming the site has more than one page).

Sample page

What do they have in common?

Header As you can see, there are three sections (also called page divisions). The top section, or division, is usually referred to as the header or branding bar. Studies have shown that the first place most people look when viewing a page is the top left corner. The header (or branding bar) often contains brand- name information about the site, such as a corporate logo

If the site contains multiple pages, the navigation bar section comes next, under the header, and it contains links to other pages within the site. The third section down is sometimes called the main content or content area. And that section can contain anything—text, pictures, lists, tables—whatever it takes to best convey the information you're trying to convey.

Create a Page Layout Modern Web pages are often organized into a page layout that consists of multiple sections or page divisions. In HTML, we use these two simple tags to define each page division: The tag marks the top or start of a division, and marks the end of the division.

div tag Since any page might contain multiple divisions, we often use multiple pairs of div tags in a page. To give each one a unique identity that we can apply styling to, we assign a name using the id= attribute, followed by the name enclosed in quotation marks. The name can be anything you like, so long as it starts with a letter and doesn't contain any blank spaces. For example, the first division on the top of the page is sometimes referred to as the page header, and so the div is also often named header as below.

Nav bar The next page division under the header is often the navigation bar, or navbar for short. Its name is often navbar or nav or something similar, and its tags might look like this: In between those tags, you'd put the code and content for a navigation bar. As always, the comment after the closing tag is optional, but it's a good idea, because it makes it easy to see which division that tag is closing.

Note HTML5 has and tags that can be used in place of divs. HTML5 is still very much in the early experimental stages and doesn't work in all current browsers. Web developers continue to use named divs, like those above.

main After the navigation bar comes the main content area. Its name is often main or content, and its tags look like this: So basically, we use a pair of div tags to define each major page division in the layout. We assign an id name to each division, because (as you'll see shortly), that allows us to create a CSS style rule for each one.

Note that these new tags don't replace or undo anything you've already learned in this course. Every page that you create still requires all of the mandatory tags you've learned about in previous lessons, including the html, head, title, and body tags. Let's go ahead and create a page that contains all of the mandatory tags as well as tags for three page divisions. We'll start with the code and a little temporary placeholder text. Follow these steps: Open the program you normally use to create and edit Web pages. (If you've been following along in this course without any prior experience, that's probably Notepad in Windows or TextEdit on a Mac). Type (or copy and paste) all of the following code into the page:

Update sample My Layout Header content goes here Links go here. Main content goes here.

Creating the Style Rules The next step is to start styling the divisions. Styling has to do with colors and such, and it's typically done with CSS style rules in the professional world of Web design. A style rule is a set of CSS property:value pairs that define the style of an element. There's a selector that describes the element that the style applies to, followed by the property:value pairs that describe the style.

Style Rules saw style rules that apply to different types of html elements. For example, the body{} style rule applies to the body element, which is defined by... tags. And the h1{} style rule applies to h1 headings (any text between... tags).

With named divs, the style rule selectors work a little differently. You don't want to use div as the style rule selector, because that style rule would apply to all divs on the page—not to just one particular page division. When you want a style rule to apply to a specific named element, you need to use the name, preceded by a # sign, as the selector. For example, this style rule applies only to the element named header: #header { }

div style tags Or in other words, it applies only to the element whose opening tag contains id="header". So any property:value pairs you put in that style rule apply only to text between these tags in the page: Let's examine another example. Take a look at this style rule: #nav { } The #nav means apply this style to the element with id="nav" in its opening tag. So that style rule applies to anything

Styling the Divisions But we only included some styled divisions and temporary placeholder text so far, so it doesn't really look special when we view the Web page in a browser. Start styling those page divisions by adding an internal style s Move the cursor just past the tag near the top of the page, and press ENTER to start a new line after that one. 1. Type (which is the tag to start the internal style sheet), and then press ENTER a couple of times. 2. Type (the closing tag for the internal style sheet), just so you don't forget to type it later. 3. Move the cursor so it's inside the internal style sheet (between the and tag).

#header { background-color: #fe9900; color: white; } #nav { background-color: #ffff66; text-align: center; } #main { }

Three style rules added to the internal style sheet The first style rule we added applies an orange color (#fe9900) to the background of the div named header, and it sets the text color inside that div to white. The second style rule applies a yellow shade (#ffff66) to the div named nav, and it centers text inside that div. Nobody knows or memorizes all the color hex codes. The third style rule is for the div named main. We haven't put any property:value pairs in that one yet, so it won't have any impact on the style of that div. But the style rule is in place, and you can add property:value pairs at any time in the future.

sample.htm

Creating a Navigation Bar Our layout still isn't too impressive yet, because at the moment, it only contains some generic placeholder text. It doesn't really have anything in the way of content. By content, I mean the words and pictures that the site is about. And those can be anything your heart desires. You can use any tags and any CSS property:value pairs you'd like to define and style your content. But you do want to think in terms of page divisions. You don't want to just start throwing stuff into the page at random. The idea behind that page division is to present links that lead to other pages within the same site. Of course, a website can have only one page—in which case, there'd be no need for links or a navigation section to put the links into.

Nav Bar Questions To create a navigation bar for your own site, you first have to make a couple of decisions: How many pages do I want in my site? What will I name those pages? You don't need to make those decisions right this moment.

CSS width: property As its name implies, that property allows you to define how wide you want an element to be. You can specify the width in pixels (using px) or in percent (using %). The % is good when you want to create equal-width columns, because you just divide 100 by the number of items you want included it the width to determine the percent width of each column. For example, if you were to have five items, each would have a width of 20% (100 divided 5). If you wanted four items, each would have a width of 25% (100 divided by 4). If you have three items, each would have a width of 33.3%. (You can't use fractions like 1/3 or 1/2 in CSS or most other programming languages. You have to use a decimal point.)

The navigation bar on most Web pages contains links to other pages within the site. There's no rule that says your site must have multiple pages though. So that division is optional. Create a relatively simple, nice-looking navigation bar for a site with five pages in it. Use a table cell for each link. To make them equal in width, I'll make each of the five cells 20% the width of the table, so the widths total 100%. Follow these steps to try it out: 1. Open layout.html in your editor (or just switch to that window if it's still open from the previous chapter). 2. Click inside the navigation bar division (between the tags and ). 3. Delete the temporary placeholder text Links go here.

nav table Home Products Services About Us Contact Us

A Look at the Code We used a table to contain the navigation bar. (You learned about tables in Lesson 5.) The table starts with and ends with. The opening tag looks like this: The width:100% ensures that the table is the full width of the browser window. While not a technical requirement, it does give the navigation bar a nice look and makes it easy to make equal-sized cells for links across the table. The cellspacing and cellpadding attributes add a couple pixels of empty space between and inside the table cells.

The... tags define a single table row. In the opening tag, we use an inline style to set the row's background color to #ffcc33 which is the orange color you see on each button. The lighter yellow color between table cells is the navbar division's background color. We defined this in the #nav style rule by setting its background color to #ffff66.

Each link is contained in a table cell that is 20% the width of the table. The opening tag for each cell is, and the closing tag is. We used 20% because there are five cells, and we want their widths to total 100% to fill the width of the table.

Inside each table cell is a link. This link (below) refers to a page named products.html that we never created: Products So when you click the link text (the underlined word Products) in the Web browser, you get an error message. Rather than painstakingly typing each page from scratch, we can start each page using code that's in the layout page. That can save a lot of typing, a lot of testing, and a lot of finding and correcting errors!

A Look at the Page Names Even though those pages don't exist, you'll notice we used relatively short, simple filenames like index.html, products.html, services.html, about.html, and contact.html. You're free to come up with whatever pages you want for your site, and you can name them pretty much whatever you want. But remember, every Web page must have an.htm or.html extension. There's no difference and no advantage or disadvantage to either one, so feel free to use whichever extension you like.

Layout Summary To define a division in a Web page, we use... tags. Because a page usually consists of multiple divisions, we often assign each division a unique identity (name) using an id= attribute. The name you give to a division can be any name you like, so long as it starts with a letter and doesn't contain any blank spaces. the first division is often named heading using as the tag. The next division, which often contains links to all of the pages within the site, is called the navigation bar. And the div tag for that one might be or something similar. Then, the main content for the page comes next and is often enclosed in a division that starts with. The main reason for giving each division a name is so that you can create a style rule for each, which allows you to define its coloring and other stylistic features. Normally, the selector for a style rule is the tag that you want the style rule to apply to. For instance, when creating a style rule for h1 elements, you just use h1 as the selector. When you want to associate a style rule with an id name rather than an element type, you have to use a # sign in front of the name to indicate an id. So the selector for an element that contains id="header" is #header.

So far, the page header in sample.html just contains some placeholder text. Open sample.html for editing in Notepad Put the text inside the header div, and delete the placeholder text that reads Header content goes here. With the cursor still in between the and, carefully type the following: Lou's Records Verify that you typed the code correctly inside the header page division, as shown in this image: Open sample.html in a Web browser. Or if it's already open in a Web browser, Refresh or Reload the page there.

Putting style="margin:0" in the h1 tags removes the default margins from the heading, thereby removing the strange empty white space below the heading and bringing the navbar up right under the orange header division. If you prefer to center the text in the header, just add text-align:center to your #header style rule, as below: #header { background-color: #fe9900; color: white; text-align:center; }

Homework Make a homepage for your website. The website must have A logo (or picture in the header area) A title A nav bar Some content Print (or write down) your index.html files and bring them to class tomorrow.