Programming

Programming intro
Java

Markup

First webpage guide
HTML
XHTML

Style & Layout

CSS

Browser scripting

Javascript
VBScript
AJAX

Server scripting

PHP
ASP

Making money online

Make money online

Writing and validating a frameset XHTML document

This tutorial focuses on writing and validating a frameset XHTML document in:

Windows

Consideration

Consider first, if the XHTML document you are creating should be a frameset XHTML document, and not one of the other XHTML document types. A frameset XHTML document specifies an XHTML document that uses frames to display one or more pages at the same time in the browser window. If you are writing an XHTML document with this purpose in mind, then it should indeed be a frameset XHTML document. Otherwise, you may want to use one of the other XHTML document types. To learn more about the different XHTML document types, read our XHTML document type definition lesson.

NOTE: Since the XHTML document in this tutorial is a frameset, it will require you to write more than one page (three in particular).

The writing process

  1. Open notepad by going to Start -> Programs -> Accessories -> Notepad OR go to Start -> Run - Type notepad and press Enter.
  2. Type in the following code:

    <html>
    <body>
    Frame 1
    </body>
    </html>
    
  3. Save the file as frame1.html

    NOTE: Make sure that you give the file a .html extension and that you save it as type 'All Files', otherwise you will get plain text.

  4. Open another instance of notepad by going to Start -> Programs -> Accessories -> Notepad OR go to Start -> Run - Type notepad and press Enter.
  5. Type in the following code:

    <html>
    <body>
    Frame 2
    </body>
    </html>
    
  6. Save the file as frame2.html

    NOTE: Make sure that you give the file a .html extension and that you save it as type 'All Files', otherwise you will get plain text.

  7. Open a third instance of notepad by going to Start -> Programs -> Accessories -> Notepad OR go to Start -> Run - Type notepad and press Enter.
  8. Type in the following code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 
    1.0 Frameset//EN" "http://www.w3.org/TR/
    xhtml1/DTD/xhtml1-frameset.dtd">
    <html>
    <head>
    <title>Frameset</title>
    </head>
    <frameset rows="50%, 50%">
    <noframes>
    <body>Your browser does not support frames!</body>
    </noframes>
    <frame src="frame1.html" name="frame1" />
    <frame src="frame2.html" name="frame2" />
    </frameset>
    </html>
    
  9. Save the file as frameset.html

    NOTE: Make sure that you give the file a .html extension and that you save it as type 'All Files', otherwise you will get plain text.

    NOTE: Make sure you save all three files in the same directory!

  10. Open your web browser.

  11. Type into the web browsers location bar the absolute location of the directory where you saved the file frameset.html along with the file name. For example, if you saved the file in C:\windows, type C:\windows\frameset.html into the web browsers location bar.

  12. You should now see an XHTML frameset document in your web browser which looks like this:

    Document result

The validation process

Now that you have written a frameset XHTML document, it's time to validate it.

  1. Go to the W3C Markup Validator, located at http://validator.w3.org.

  2. The W3C Markup Validator gives you the option of validating a document by URL, by File Upload, or by Direct Input. In this tutorial, you will be validating the document by File Upload. Find the label that says "Local File:" and click the button that says "Browse...." which is directly parallel to it.

  3. Locate the frameset.html file on your hard drive, and when you are ready to validate the document, click the button that says "Check"

  4. If the document did not validate, you should get a message saying "This page is not Valid XHTML 1.0 Frameset!"

    Possible reasons for the document not validating:

    • Missing closing tags
    • Tags not closed in the right order
    • Attribute values not quoted properly
    • A missing <!DOCTYPE> declaration

    Read the description of the error(s) that the Markup Validator provides. It is usually very descriptive.

  5. If the document did validate, you should get a message saying "This Page Is Valid XHTML 1.0 Frameset!"

    You now have a valid XHTML frameset document!! This means "that you have taken the care to create an interoperable Web page" as is stated by the W3C Markup Validator.

Linux

Consideration

Consider first, if the XHTML document you are creating should be a frameset XHTML document, and not one of the other XHTML document types. A frameset XHTML document specifies an XHTML document that uses frames to display one or more pages at the same time in the browser window. If you are writing an XHTML document with this purpose in mind, then it should indeed be a frameset XHTML document. Otherwise, you may want to use one of the other XHTML document types. To learn more about the different XHTML document types, read our XHTML document type definition lesson.

NOTE: Since this XHTML document in this tutorial is a frameset, it will require you to write more than one page (three in particular).

The writing process

  1. Open nano and type in the following code:

    <html>
    <body>
    Frame 1
    </body>
    </html>
    
  2. Save the file as frame1.html

  3. Open another instance of nano and type in the following code:

    <html>
    <body>
    Frame 2
    </body>
    </html>
    
  4. Save the file as frame2.html

  5. Open a third instance of nano and type in the following code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 
    1.0 Frameset//EN" "http://www.w3.org/TR/
    xhtml1/DTD/xhtml1-frameset.dtd">
    <html>
    <head>
    <title>Frameset</title>
    </head>
    <frameset rows="50%, 50%">
    <noframes>
    <body>Your browser does not support frames!</body>
    </noframes>
    <frame src="frame1.html" name="frame1" />
    <frame src="frame2.html" name="frame2" />
    </frameset>
    </html>
    
  6. Save the file as frameset.html

    NOTE: Make sure you save all three files in the same directory!

  7. Open your web browser.

  8. Type into the web browsers location bar the absolute location of the directory where you saved the file frameset.html along with the file name. For example, if you saved the file in /home/user1/desktop, type /home/user1/desktop/frameset.html into the web browsers location bar.

  9. You should now see an XHTML frameset document in your web browser with two frames. The first frame should read "Frame 1", and the second frame should read "Frame 2"

Screenshot for Linux coming soon..

The validation process

Now that you have written a frameset XHTML document, it's time to validate it.

  1. Go to the W3C Markup Validator, located at http://validator.w3.org.

  2. The W3C Markup Validator gives you the option of validating a document by URL, by File Upload, or by Direct Input. In this tutorial, you will be validating the document by File Upload. Find the label that says "Local File:" and click the button that says "Browse...." which is directly parallel to it.

  3. Locate the frameset.html file on your hard drive, and when you are ready to validate the document, click the button that says "Check"

  4. If the document did not validate, you should get a message saying "This page is not Valid XHTML 1.0 Frameset!"

    Possible reasons for the document not validating:

    • Missing closing tags
    • Tags not closed in the right order
    • Attribute values not quoted properly
    • A missing <!DOCTYPE> declaration

    Read the description of the error(s) that the Markup Validator provides. It is usually very descriptive.

  5. If the document did validate, you should get a message saying "This Page Is Valid XHTML 1.0 Frameset!"

    You now have a valid XHTML frameset document!! This means "that you have taken the care to create an interoperable Web page" as is stated by the W3C Markup Validator.

Mac

Coming soon..

Step-by-step tutorials
Programming intro
HTML
XHTML
CSS
Javascript
Java

Practice

Online code editor
Practical examples
Practical exercises

Reference

Terms glossary
Reference material

Rate this site

Rate this site
Visitor comments