Home arrow HTML arrow Page 2 - Frames and Lists in HTML
HTML

Frames and Lists in HTML


In our previous article we learned to work with links and entities (or special characters) in HTML and how HTML handles white space. In this episode we will discuss how to use frames to create pages within the page and how to use lists.

Author Info:
By: James Payne
Rating: 4 stars4 stars4 stars4 stars4 stars / 5
January 23, 2008
TABLE OF CONTENTS:
  1. · Frames and Lists in HTML
  2. · Setting a Frame in the Horizontal Position
  3. · Displaying Frame with the Iframe
  4. · Lists in HTML
  5. · The Unordered List
  6. · Working with Nested Lists

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Frames and Lists in HTML - Setting a Frame in the Horizontal Position
(Page 2 of 6 )

Framesets use the rows property to set the frames in the horizontal position. The size of the frames works in the same manner as our previous example:


<html>


<frameset rows="20%,40%,40%">


<frame src="firstframe.htm">

<frame src="secondframe.htm">

<frame src="thirdframe.htm">


</frameset>


</html>

Setting the Frame Horizontally and Vertically

As I mentioned before, you can set your frame both vertically and horizontally. This is useful for a variety of reasons. You could have your navigation frame on the left, an advertising frame at the top, and a page in the middle that displays the pages in your site when the user clicks on the links in your navigation frame. Here is how we set the frames:


<html>


<frameset rows="20%,70%">


<frame src="adframe.htm">


<frameset cols="20%,80%">

<frame src="navframe.htm">

<frame src="mainframe.htm">



</frameset>


</frameset>


</html>

As we discussed, you can use a frame as a navigation frame. When the user clicks on the links in this frame, it will load them in a different frame that you specify. To do so, you must create links to target the frame in which you wish the pages to load. You do that like this:


<a href ="aboutusframe.htm" target ="mainframe">About Us</a>

The above snippet of code creates a hyperlink in the phrase “About Us.” The hyperlink will load the page aboutusframe.htm in the mainframe frame. So let’s say you want to create a standard navigation menu, you would have a frame as your navigation frame (we will call it navframe). You would place these links within that page:


<a href ="homeframe.htm" target ="mainframe">Home><br></a>

<a href ="biographyframe.htm" target ="mainframe">Bio<br></a>

<a href ="commentsframe.htm" target ="mainframe">Comments<br></a>

<a href ="linksframe.htm" target ="mainframe">Links<br></a>

<a href ="aboutusframe.htm" target ="mainframe">About Us<br></a>

This creates a set of links for Home, Biography, Comments, Links, and an About Us page. When the user clicks any of these, it will load its respective page in the mainframe frame.


blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 2 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials