1 - Introduction

 2 - Quick start

 3 - Using KompoZer

 4 - Stylesheets

 5 - Scripts

 6 - Inserts

 7 - Templates

 8 - Site Manager

 9 - Preferences

10 - Publishing

     Appendices

This page was composed using KompoZer

Traduction française
Flag-Japan 日本語訳=

KompoZer User Guide - Section 3

3    Using KompoZer

KompoZer screen layout

3.1 Finding your way around

When KompoZer starts the window carries a menu bar across the top (File, Edit, View etc). Below this are three 'Toolbars'. To ensure that everything is visible, on the Menu bar select View > Show/Hide and see that each of the following is checked: Composition Toolbar, Format Toolbar 1, Format Toolbar 2, Edit Mode Toolbar, Status bar, Rulers, Site Manager.

The three toolbars across the top of the window carry buttons (represented by icons). Hover on any to find its function. If any are greyed out they are not functional in the current mode as they are context sensitive.

Note Not all buttons are installed initially. The full list is given in section 9.3 Customising toolbars

Across the centre of the window are two panes: the 'Site Manager' on the left and a blank web page on the right. The Site Manager is a powerful tool which is covered in section 8. Since it is not needed yet it may be closed by clicking on its close button or pressing F9.

At the top of the Page area there is a Page tab which carries the name of the page (‘Untitled’). (KompoZer Help refers to this as the ‘Tab Browser’ toolbar.) If you had several pages open, as shown in the figure, this tab would allow you to select one them rapidly.

At the bottom of the page area is the ‘Edit Mode Toolbar’ which carries four tabs which select one of four ‘Viewing modes’ for a page (‘Normal’, 'HTML Tags', 'Source', 'Preview'.)

For details of viewing modes see section 3.15.

At the bottom of the window is the 'Status Bar'. This is a very powerful tool. Once a page is populated, by clicking any item in the page area its structure appears on the status bar. Any class or id applied to an element is shown and any bearing an inline style is indicated in italic type. Hovering reveals the style declaration. Additionally clicking an element marker highlights the element in both normal view and, on changing view, in source view thus simplifying navigation in source view.

Note The figure shows the buttons as they appear when KompoZer is first installed. They may be customised to different arrangements (see section 9.3). If this has been done some of the following may be difficult to follow. To restore defaults click View > Show/Hide > Customize Toolbar > Main Toolbar > Restore Default Set and repeat similarly for the Format Toolbar.
Using KompoZer right-click any toolbar to customise it.

3.2 Starting a page

A new page can be created either from a blank page or by opening any pre-existing page.

Note There are often several ways of getting KompoZer to do something. This guide will use the button on the Composition toolbar if that is available. For menu equivalents see section 9.3 Menu alternatives

3.2.1 Document types (Doctype)

Web pages use the HyperText Markup Language (HTML). There are number of variants of the basic language some details of which are outlined in Appendix 3. KompoZer is capable of creating and editing four variants but for simplicity of explanation I recommend that users create the Strict HTML variant. I also recommend that you go the menu item Tools > Options > General and check the box 'Use CSS Styles instead of HTML Elements ...' this will give you the maximum functionality. You can edit documents which have been originated in other variants and again 'Use CSS Styles ...' gives maximum functionality.

Note If you find a button or menu item disabled it is likely to be a because 'Use CSS Styles ...' is not set but could be because of the context of the action.

3.2.2 Options for starting a page

There are several ways to start new pages or open existing ones.

To start a new blank page.

On the menu bar click File > New.

A window headed ‘Create a new document or template’ appears. Check the boxes ‘A blank document’ and ‘Strict DTD’ and clear ‘create a XHTML document’. (Without Strict DTD checked the document would have ‘Transitional’ DTD.)

Note If you wish to make these your defaults which are offered every time you create a new page click Tools > Options > Advanced and check the boxes Markup Language: 'HTML 4' and DTD: 'Strict'.

The use of templates is covered in section 7.

To open an existing page.

Either:

  1. Click the OPEN button to access a normal browse dialogue.
  2. Click File > Recent Pages to get rapid access to those recently worked on.
  3. Or use the Site Manager (section 8) which provides a powerful mini-browser and is very easily set up.

The doctype of an existing page will remain the same as before it was opened. It cannot be changed in KompoZer.

Each page opened starts in a new tab which can be clicked to select a document to work on.

3.3 Editing in KompoZer

Tip: The plus sign (+) means that you must press two keys surrounding the plus sign at the same time.

KompoZer supports all the standard Windows editing commands and shortcut keys. e.g. Copy Ctrl+C, Paste Ctrl+V etc. There are other KompoZer specifics. These are great time savers.

In ‘HTML Tags’ view KompoZer supports drag and drop editing for block items. (Select an item by pressing the Control key while clicking on the Tag.)

An extreme time saver is KompoZer’s double click response. In several cases, such as links, images and tables, a very useful editing window is opened.

KompoZer supports many levels of Undo and Redo, however changes made in ‘Source’ view cannot be undone after you have changed the view.

3.3.1 Tutorial – Brief introduction to HTML

HTML stands for HyperText Markup Language. It is the publishing language of the World Wide Web on which KompoZer is based. Ideally it should be possible to use KompoZer without any knowledge of this language and certainly without a knowledge of the details. As a precaution however a limited understanding is desirable. This tutorial covers a minimum of detail while introducing some useful features of KompoZer.

Start a new blank page as described above.

On the status bar click on the '<> Source' tab. You will see a number of terms enclosed within angle <> brackets. These are HTML ‘Tags’. Everything starting from the <body> and finishing with will appear on your web page.

Note In most cases tags occur in pairs – opening tags and closing tags – Closing tags always start with a forward slash.

All the page consists of now is a
tag which is a line break and which is, of course, invisible.

Later as a page builds up many more tags will be added. For the most part the pairs of tags enclose ‘contents’ from which the page is built up – items like Paragraphs, Headings, Tables, Images. The tags plus the contents are called ‘elements’. The tag names are usually either the same as element names or abbreviations of them. Some examples are ‘table’, ‘img’ for image, ‘p’ for paragraph, ‘br’ for line break (which is unusual in having no closing tag).

Nothing between the <head> and tags will appear on the screen but may have quite useful functions nonetheless. For instance, between the <title> and tags there isn’t anything. Go for it, between them type “My first page” or something like that. Click the tab for ‘Normal’ view, now the tab at the top carries your page title and you’ve edited raw HTML. Well done!

If you were too timid to do this all is not lost. There is no need to use source view at all. Go to Format > Page Title and Properties. Here you can enter various parameters including the title and the language you are writing in. These will be entered in the HEAD area for you. In some circumstances they can be important; the Title and Description, for instance, can be used by search engines to index the page.

Back to '<> Source'. Notice the first tag is <html> and the last . All web pages must carry these in these positions. Actually the case doesn’t matter for any tag though it’s good practice to use lower case. (For XHTML lower case is mandatory.)

The first line, in a different colour, specifies the ‘Doctype’. This is a reference to the type of HTML document. KompoZer determines the doctype according to the options selected on starting a page.

Tip: Filenames should generally be composed of unaccented letters, numbers and the underscore character. Some others are permissible but the rules for incorporating them are more complex.

Tip: Web pages are stored (hosted) on servers which usually run either a version of Windows or UNIX operating systems. UNIX filenames are case-sensitive while Windows are not. For this reason if you use mixed cases in filenames you must be very rigorous. A site which runs perfectly in your local Windows environment or on a host running Windows if transferred to a UNIX system might require extensive and time-consuming changes.

Finally, give the document a name and save it.

3.3.2 Saving files

Go to File > Save as.

You are offered a ‘Save Page as’ window which allows you to browse to the folder you want to use. You will find the file name already completed with your page title. You will probably want to change this to a shorter, all lower case, name (but you don’t have to). You will find the file extension completed as ‘html’ you may prefer to, and you may alter it to “htm”.

Note If you have hidden extensions for file types this becomes unavailable. Hide or view extensions is controlled in Windows by Control Panel > Folder options > View then scroll down and clear 'Hide extensions for known file types'.

After you edit files you need to re-save periodically. Click the ‘Save’ button.

Note KompoZer includes a small red warning icon in the page tab to indicate if a page has not been saved.

There is nothing mysterious about the files. The curious may open the file using any text editor e.g. Windows notepad. What you will see will look just like the HTML Source code you’ve been looking at in ‘Source’ view. This shows that the source is just a simple text document.

3.3.3 Printing pages

The ‘Print’ button allows you to print the current page to a printer. This prints the page view and not the source code.

3.4 Working with text

3.4.1 Text on a page

3.4.1.1 Introduction

Text typed directly onto the KompoZer page defaults to appearing in the format for the ‘body’ element. HTML defines a small number of elements specifically for text and it is usually preferable to use these.

To format text in a standard element format select the text (it is actually necessary simply to click anywhere within the block of text) and click the first drop-down box on the format toolbar. This offers a selection of standard text formats. Paragraph is the most appropriate for general text.

Once formatted as a paragraph, when typing in a text area, use of the ‘enter’ key starts a new block of text i.e. a paragraph. To start a new line within the current paragraph press Shift+Enter; this generates a line break.

Note This is the default action and can be altered. (See Toolbars section 9.3)

Other standard text formats are Heading formats from Heading 1, the largest (for the main heading), to Heading 6, the smallest (for the least significant). Browsers generally render headings in bold type.

Text can be edited in any of the viewing modes and KompoZer responds to all the normal windows shortcut commands.

3.4.1.2 Block or Inline

Tip: The outline of each block of text can be revealed by selecting View > Block outline. The dimensions of each block in pixels are shown on the rulers at the top and side of the page.

The elements just described mark out ‘blocks’ of text.

3.4.2 Formatting text

Tip: Text to be formatted may be selected in one of several ways.

Text can be formatted in a number of ways using a format toolbar. The changes listed in the table can be applied (hover over a tool to discover what it does).

Choose a font *
Choose text colour * Choose background colour *
Choose highlight colour *
Make text smaller * Make text larger *
Embolden * Italicise *
Underline *
Format as a numbered list Format as a bulleted list
Align left Align Centre Align right Justify
Indent text Outdent text
Emphasise * Strongly emphasise *

Note 1 For the options marked with an asterisk select an inline section of text. This allows you to have a few words in a paragraph of a different size etc. (When you do this, if you use the 'HTML Tags' view, you will see the start of the change marked with a ‘Span’ marker.)

Note 2 'Choose background color' sets the colour for the background of the current block. If 'Use CSS Styles ...' is not checked, with Nvu it changes the background colour for the complete page, with KompoZer it has no effect.

Note 3 The emphasis button will result in italicised text with most browsers and the strong emphasis button in bold text.

Warning. When using Strict Doctype check 'Use CSS styles instead of HTML elements and attributes' in Tools > Options > General to ensure availability of all options.

3.4.3 Positioning text

Generally the position of text is determined by the fact that one block flows on after the previous one etc.

The space between blocks is determined by the browser. Through the use of styles (see section 4.2.1.4) these settings can be altered.

Paragraph and heading blocks stretch from one side of the screen to the other. This a very elegant way of operating. Try resizing the KompoZer window. Until it becomes so narrow that nothing can fit, the text reformats so that it still fits – though narrower it becomes longer. It is fundamental to the way the web operates that it is designed for information transmission and not presentation. Web design tools allow us to refine presentation but, if we over constrain it, we may run into problems of getting it to fit on the screen. We really should allow the browser as much freedom as possible.

3.4.3.1 Fixed width text

KompoZer allows you to constrain the width of paragraphs. (The same applies to headings.) Try this. Set the window size so that it is somewhat narrower than the full screen width i.e. so that you have space either to narrow it more or to widen it.

Take two longish but similar paragraphs which fill about half of the window. Click in one, you will see the rulers both across the top and down the side. Grab the left edge of the ruler and draw it half way across the window. Do the same for the other paragraph but take the right edge of the ruler and drag it half way to the centre but in the opposite direction.

You probably think that you’ve achieved a rather elegant layout and discovered a flexible tool. Drag the window to be wider then narrower. Do you still think so? What you have done is to set the text to be in a fixed position and of fixed width. It no longer re-flows. Consider that visitors who view your pages may have smallish or very large screens. Will they all see what you want them to?

Tip: Instead of using HTML Tags view it is quicker just to click in the paragraph and click the corresponding

marker on the status bar. This will highlight the paragraph. After that just right click as described.

Supposing that you don’t like what you have just done – you can just Undo it – press the Undo button or click Ctrl+Z. However if you leave it to later you would first have to undo all later work. You can re- or de-format a paragraph directly and individually. This allows you precise control rather than relying on dragging the ruler. Go to 'HTML Tags' view, click on the yellow 'p' marker for a paragraph, on the status bar right-click on the highlighted 'p' area and select ‘Inline styles’. In the general tab that appears just delete the text and click 'OK'. Alternatively select ‘Box Properties’. This allows precise editing of the paragraph within the ‘box’ in which it is contained.

3.4.4 Lists

3.4.4.1 Numbered and Bulleted lists

KompoZer can format a list of items giving each item a sequential number in any of several formats (HTML calls these ordered lists

    ) or presenting them bulleted (unordered lists