17
Frames

Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

Embed Size (px)

Citation preview

Page 1: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

Frames

Page 2: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

Using Frames?

Rarely used Printing, bookmarking & resizing

problems.Frames can look different from browser to

browser.Hard to design (need to know the size).Can be good for navigation.

Page 3: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

Code Basics

The < frameset> tag replaces the body tag.

<frameset cols="150, *"><frameset rows=”33%, *"><frame src="links.html" />

Page 4: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

Frames Layout

You can think of it like tables.<frameset cols="150, *"> or rows is

similar to the <tr> tag. <frame src="links.html" /> is similar

to the <td>plan out how you want the frames to

look and work.

Page 5: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

Frame Source

The source indicates the HTML file/page that is loaded in that frame.

<frame src="links.html" name="links" /> The name attribute names the frame, to load

other HTML pages into that specific frame. <frame src="home.html" name="main" />

Page 6: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

The Target

Once a frame has been named you can use target code to force pages to load within that specific frame.

<a href="products.html" target=”main">

In the frames page: <frame src="home.html" name="main" />

Page 7: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

Target Attributes

<a href="products.html" target=”?”>target="main"> Name of the frametarget=” _blank” (or “new”) Opens a new

windowtarget=” _self” Loads the page in the

same frametarget=” _top” Breaks out of frames with

this page.

Page 8: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

Target Attributes

<base target=”links”> This sets the default target for every

link on the entire Web page.This code is placed (nested) in the

<head> tags.

Page 9: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

Nested Frames

<frameset rows="110, *,25%"> <frame src="header.html" name="top" /> <frameset cols="150, *"> <frame src="links.html" name="links" /> <frame src="home.html" name="main" /> </frameset> <frame src="bottom.html" name="bottom" />

</frameset>

Page 10: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

More Frameset Attributes

<frameset rows="110, *,25" border=“0” IE does not need the border

tag, however Netscape does. Controls the borders width in pixels.

frameborder=“0” value of no or 0, or 1. It places this dark line between borders. I never use.

framespacing="10"> Works like Cell Spacing, Space in pixels between the frames.

Page 11: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

More Framesource Attributes

<frame src="frames-sidebar.html”>scrolling=“?” no, yes or Auto (default) If

I insert the "scrolling" attribute and assign a value of "no", all scroll bars will disappear, and some of the content of the pages could be lost.

marginheight=“15” In pixels. This works like Cell Padding but only from top to bottom.

marginwidth="10"> In pixels. This works like Cell Padding but only for the two sides.

Page 12: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

Non-support of frames

<noframes> </noframes> The text listed between these tags serves three important purposes: It is indexed by search engines. Contributes to your ranking at a search engine. Provides visitors who are using a browser that

does not support frames a way to access your pages.

Page 13: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

No frames example

<noframes> Welcome to David Hanson’s Family home page.

This site can be viewed only with a frames capable browser. We invite you to visit our <a href=index-no-fr.html">non-frame site</a>. </noframes>

Page 14: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

iframe

iframe allows you to define a frame within a conventional HTML document.

The iframe does not use the frameset code. If fact it’s usually used inside a table.

Page 15: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

iframe example

<iframe src="soldier.html" name="main" width="500" height="400" align="right" frameborder="0">If you can't see the picture, then your browser doesn't support iframes. You may want to update to the most current version of your browser. </iframe>

The written part will not be seen if the browser supports Iframes.

Page 16: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

Homework

FramesHTML Code - 10 pointsNew window (_blank)- 10 points Break out of frames (_top) - 10

pointsPlease email me your URL

Page 17: Frames Using Frames? zRarely used zPrinting, bookmarking & resizing problems. zFrames can look different from browser to browser. zHard to design (need

Questions

If you need help, send me an email at both addresses!