Nvu User Guide and Tutorial
Nvu User Guide and Tutorial
Nvu
Nvu
Introduction..........................................................................................................................7 1.1 What is Nvu? What does it do?..................................................................................7 1.2 Who is Nvu for?............................................................................................................7 1.3 Scope of the guide.........................................................................................................7 1.4 Methodology .................................................................................................................7 1.5 Navigation........................................................................................................................8 1.6 KompoZer ........................................................................................................................8 2 Quick start............................................................................................................................9 2.1 Preliminary.......................................................................................................................9 2.2 To create a new page: ...................................................................................................9 2.3 To open an existing page ..............................................................................................9 2.4 Editing a web page........................................................................................................9 2.5 Saving a Page................................................................................................................9 2.6 Browsing a page............................................................................................................9 2.7 Help.............................................................................................................................10 3 Using Nvu ..........................................................................................................................11 3.1 Finding your way around ...............................................................................................11 3.2 Starting a page................................................................................................................12 3.2.1 Document types (Doctype) .....................................................................................12 3.2.2 Options for starting a page......................................................................................12 3.3 Editing in Nvu................................................................................................................13 3.3.1 Tutorial Brief introduction to HTML ..................................................................13 3.3.2 Saving files..............................................................................................................14 3.3.3 Printing pages..........................................................................................................15 3.4 Working with text ..........................................................................................................15 3.4.1 Text on a page.........................................................................................................15 3.4.2 Formatting text........................................................................................................16 3.4.3 Positioning text .......................................................................................................17 3.4.4 Lists.........................................................................................................................18 3.4.5 More formatting ......................................................................................................19 3.4.6 Importing text..........................................................................................................19 3.4.7 Special characters....................................................................................................20 3.4.8 Checking spelling....................................................................................................21 3.4.9 Viewing text............................................................................................................22 3.5 Working with images.....................................................................................................22 3.5.1 Inserting images ......................................................................................................22 3.5.2 Positioning and resizing images..............................................................................23 3.6 Using tables....................................................................................................................24 3.6.1 Inserting tables ........................................................................................................24 3.6.2 Formatting tables ....................................................................................................25 3.6.3 Inserting Text ..........................................................................................................29 3.6.4 Centring tables ........................................................................................................29 3.6.5 Improving tables .....................................................................................................30 3.7 Links ..............................................................................................................................30 3.7.1 Linking text.............................................................................................................30 3.7.3 Editing Links...........................................................................................................33 3.8 Frames............................................................................................................................33
Nvu 3.9 Forms .............................................................................................................................33 3.9.1 Introduction.............................................................................................................33 3.9.2 To set up a form ......................................................................................................34 3.9.3 Form control styles .................................................................................................34 3.10 Layers...........................................................................................................................35 3.10.1 What layers are .....................................................................................................35 3.10.2 Creating layers ......................................................................................................35 3.10.3 Characteristics of layers........................................................................................36 3.10.4 Manipulating layers ..............................................................................................36 3.10.5 Gluing ...................................................................................................................37 3.10.6 Doing it in style.....................................................................................................37 3.10.7 Using classes.........................................................................................................38 3.11 Borders.........................................................................................................................39 3.12 The Body......................................................................................................................39 3.13 Table of contents..........................................................................................................40 3.13.1 Introduction...........................................................................................................40 3.13.2 Inserting a Table of Contents................................................................................41 3.13.3 Methods.................................................................................................................42 3.14 The Head area ..............................................................................................................42 3.15 Page views ...................................................................................................................42 3.16 Editing in Source view.................................................................................................43 3.17 Selecting items - Reprise .............................................................................................44 Style and stylesheets ..........................................................................................................46 4.1 Introduction to style ....................................................................................................46 4.1.1 Power of styles.....................................................................................................46 4.1.2 Classes..................................................................................................................46 4.1.3 Using style ...........................................................................................................46 4.2 Creating styles.............................................................................................................48 4.2.1 Internal styles .......................................................................................................48 4.2.2 Styling multiple elements ....................................................................................55 4.2.3 Named Classes .....................................................................................................55 4.2.4 External styles......................................................................................................57 4.2.4.4 Saving stylesheets ................................................................................................59 4.2.5 Other style selectors................................................................................................59 4.3 Removing styles..........................................................................................................61 4.4 Inheritance..................................................................................................................61 4.5 The division <div> element ...........................................................................................62 4.5.1 Creating divs ...........................................................................................................62 4.5.2 Styles within a div...................................................................................................63 4.5.3 Creating a layer using a div ....................................................................................63 Scripts ................................................................................................................................64 Inserts.................................................................................................................................65 Templates...........................................................................................................................67 7.1 What are templates?....................................................................................................67 7.2 Create a new template.................................................................................................67 7.3 Saving templates .........................................................................................................68 7.4 Create a template from a page ...................................................................................68 7.5 Setting up template details .........................................................................................68 7.6 Using templates...........................................................................................................70 7.7 Editing templates ........................................................................................................71
5 6 7
Nvu Site Manager ......................................................................................................................72 8.1 Overview....................................................................................................................72 8.2 Setting up sites ...........................................................................................................72 8.3 Site Manager Functions .............................................................................................73 8.4 Remote sites ...............................................................................................................73 9 Setting preferences.............................................................................................................75 9.1 Preferences ..................................................................................................................75 Defaults ............................................................................................................................75 9.2 Editing preferences ........................................................................................................76 General group...................................................................................................................76 Fonts.................................................................................................................................77 New page settings ............................................................................................................77 Advanced .........................................................................................................................78 9.3 Toolbars ......................................................................................................................79 Customising Toolbars ......................................................................................................80 Menu alternatives.............................................................................................................80 10 Publishing ........................................................................................................................82 10.1 Introduction..................................................................................................................82 10.2 Validating the site. ....................................................................................................82 10.2.1 Markup Cleaner .................................................................................................82 10.2.2 Browser testing ..................................................................................................82 10.2.3 Formal validation ...............................................................................................83 10.3 Publishing .................................................................................................................83 10.3.1 Setting up your site ............................................................................................83 10.3.2 Uploading...........................................................................................................84 Cest fini ! ................................................................................................................................85 Appendices...............................................................................................................................86 A1 Glossary ..........................................................................................................................86 A2 References ......................................................................................................................88 A3 Doctypes.............................................................................................................................88 A 3.1 Introduction.............................................................................................................88 A 3.2 Doctypes supported.................................................................................................88 A 3.3 Differences between transitional and strict DTD.......................................................89 A 3.4 Choice of language and DTD....................................................................................89 A 3.5 Nvu capability ............................................................................................................90 A 3.6 Browser responses......................................................................................................91 A4 Installing Nvu and extensions ............................................................................................91 A4.1 Installing Nvu..............................................................................................................91 A4.2 Reinstalling/updating ..................................................................................................91 A4.3 Installing extensions....................................................................................................92 A4.4 Managing profiles .......................................................................................................93 Nvu Tutorial.............................................................................................................................95 Chapter 1: Introduction ............................................................................................................95 From NvuTutoriaWiki .....................................................................................................95 User Interface.......................................................................................................................95 Composition Toolbar .......................................................................................................95 Formatting Toolbar ..........................................................................................................96 Customizing Toolbars......................................................................................................98 Tabbed Interface ..............................................................................................................98 Sample Text .........................................................................................................................98 8
Nvu Chapter 2: Formatting Text....................................................................................................100 From NvuTutoriaWiki ...................................................................................................100 Heading Levels ..................................................................................................................100 Paragraph ...........................................................................................................................101 Bold, Italic and Underline text...........................................................................................101 Choosing a Font Face.........................................................................................................101 Font Color ..........................................................................................................................102 Background Color and Highlighting Text .........................................................................102 Creating Lists .....................................................................................................................103 Justifying Text ...................................................................................................................103 Emphasizing Text ..............................................................................................................103 Sample Text .......................................................................................................................104 Sample Text .......................................................................................................................104 Stats....................................................................................................................................104 A Numbered List................................................................................................................104 Interesting Links ................................................................................................................105 Chapter 3: Creating Hyper Links...........................................................................................106 From NvuTutoriaWiki ...................................................................................................106 Creating Internal Links ......................................................................................................106 Creating External Links .....................................................................................................106 Sample Text .......................................................................................................................107 Sample Text .......................................................................................................................107 Stats....................................................................................................................................108 A Numbered List................................................................................................................108 Interesting Links ................................................................................................................108 Chapter 4: Inserting Images and Tables.................................................................................109 Inserting Images.................................................................................................................109 Creating Tables ..................................................................................................................109 Sample Text .......................................................................................................................110 Sample Text .......................................................................................................................110 Stats....................................................................................................................................111 A Numbered List................................................................................................................111 Chapter 5: Publishing Your Web Pages.................................................................................112 From NvuTutoriaWiki ...................................................................................................112 To Publish A Webpage ......................................................................................................112 Site Manager ......................................................................................................................112 Publishing ..........................................................................................................................113 Sample Text .......................................................................................................................114 Sample Text .......................................................................................................................114 Stats....................................................................................................................................114 A Numbered List................................................................................................................115 Chapter 6: Further Reading and Postscript ............................................................................116 From NvuTutoriaWiki ...................................................................................................116 Further Reading .................................................................................................................116 Postscript............................................................................................................................116
Nvu
1
1.1
Introduction
What is Nvu? What does it do?
Nvu is a complete Web Authoring System which integrates web page development and web file management. It provides a web page editor which has a simple graphical (wysiwyg what you see is what you get) interface. With Nvu, newcomers will quickly and easily be able to produce new web pages and existing pages may be easily updated Alternative editing views of the pages are provided right down to detailed code level. The output code is compliant to a high extent with the latest issues of the appropriate web language specifications and pages may be checked for validity directly from Nvu using the official W3C validator. Nvu incorporates a Site Manager this gives rapid access to the files on both local machines and remote servers. It can cater for several sites and switch rapidly between them. From within Nvu pages and associated files may be uploaded to a remote server. Nvu supports the use of Styles through Cascading Style sheets (CSS) both embedded and external. It has an editor which generates CSS code conforming with CSS 2.1 specifications.
1.2
Nvu appears suitable for anyone wishing to have a modern, free of charge, program for developing small web sites and who would like to learn modern web design techniques such as the use of CSS.
1.3
The guide has been written from the point of view of the Windows Operating system so details may differ for other systems. It is intended as a reference document although in a few places it uses a tutorial approach. Although web pages can appear on screen, in print or in audio the guide is confined to onscreen uses.
1.4
Methodology
The approach taken by the guide attempts to satisfy the needs both of the comparative novice who has little knowledge of web design tools, and those making the transition from other tools and who may have considerable knowledge of the field.
Nvu Although the Guide is not intended for the complete beginner, concepts are introduced progressively and gradually added to. To avoid being too repetitive I have, in a number of places, referred to subjects yet to come. This applies, in particular to the use of styles in which Nvu is strong. I suggest that these references are disregarded at first reading and returned to later. This will not prevent understanding later parts. Those in a hurry wanting details of some particular feature and no more are recommended to the pdf version of the Guide which has a full subject index and is available from the same sitehttp://www.nvudev.org/guide/1.0PR/.
1.5 Navigation
Navigate around the ten sections of the Guide and the appendices using the menu pane on the left hand side. In each section the menu expands to show more detail within that section. Cross references throughout are hyperlinked. The buttons at the top of each page give access to some supplementary aids and information. The 'Site map' contains a detailed table of contents of the whole guide while the 'Quick index' gives access by subject.
1.6 KompoZer
The development of Nvu was completed with the release of version 1 in June 2005. No further development is expected though the developer Daniel Glazman of Disruptive Innovationshttp://disruptive-innovations.com/ is working on a newer product which will probably supersede it. After version 1 release a number of shortcomings were revealed and an independent developer using the name of Kaz worked on several of these and released an enhanced product as KompoZer. The operation of KompoZer is almost identical to that of Nvu though it includes a number of small enhancements and the majority of Nvu users have probably transferred to using this version. The main difference in the user interface is in the CSS editor but even here users have been able to use it without further instruction. This revision of the User Guide does however cover these changes. This version of the User Guide reflects the behaviour of KompoZer at version 0.77. The next version is anticipated shortly and will incorporate some enhancements. The program is completely free and can be downloaded from KompoZer's web sitehttp://kompozer.sourceforge.net/. You can install both Nvu and KompoZer on the same machine. I recommend that you run only one at a time closing one if you wish to run the other. In this User Guide where the term Nvu is met it should be interpreted as including KompoZer unless a distinction is made.
Nvu
Quick start
2.1 Preliminary
Open Nvu The main window opens. At the top are a number of toolbars. The topmost is the Menu Bar. This carries a number of items (File, Edit etc) used to make selections. The next is the Composition Toolbar which carries a number of Buttons labelled New, Open etc.
2.2
2.3
Assuming that the page is stored on your local disk in HTML format: On the menu Bar click File then Open File. Browse to the file and click Open.
2.4
Your web page blank or otherwise is in the large pane in the centre right of the Nvu application window. Many editing functions are very similar to those in a word processor. The top four toolbars on the Nvu application window provide a number of editing functions to see what any do hover the cursor over an item and a hint will appear.
2.5
Saving a Page
To save a page:
On the Composition toolbar click Save. If it was a new document a dialog window will ask you to enter a title for the page. This will appear in the tab at the top of the page display area. NB this is NOT the file name. Click OK; you will then be offered a normal save window which allows you to browse to a suitable location and name the file. The file extension offered will be HTML.
2.6
Browsing a page
To see how your page will look in your default browser on the Composition toolbar click Browse.
Nvu
2.7
Help
The Nvu help system should be a first resort in case of need. KDS Sahambihttp://nvu.kellertechnologies.com/. has written a useful tutorial for beginners which you may like to look at. It is shorter than this User Guide. The forum at http://wysifauthoring.informe.com/ is a place for sharing experiences and obtaining and giving help. Many of the contributors are Nvu users who range from beginners to those with lots of experience.
10
Nvu
Using Nvu
11
Nvu Note The figure shows the buttons as they appear when Nvu 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.
12
Nvu 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 Nvu. Each page opened starts in a new tab which can be clicked to select a document to work on.
13
Nvu 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 </head> tags will appear on the screen but may have quite useful functions nonetheless. For instance, between the <title> and </title> tags there isnt 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 youve 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 </html>. All web pages must carry these in these positions. Actually the case doesnt matter for any tag though its 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. Nvu 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.
14
Nvu 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 youve been looking at in Source view. This shows that the source is just a simple text document.
3.4.1.1 Introduction
Text typed directly onto the Nvu 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 Nvu responds to all the normal windows shortcut commands.
15
Blocks usually begin on a new line. Blocks have gaps above and below controlled by margins (see section 4.2.1.4). Vertical margins collapse i.e. The larger margin is applied the smaller is ignored.
Simply place the cursor anywhere in a block. Where the formatting desired can only apply to a complete block this is sufficient. Double-click within a block to select a word. Triple click within a block to select a line of text. Drag across a section of text to highlight and select that section only. In HTML Tags view press the Control key while clicking on the tag for the block to select the complete block. Using the status bar. See section 3.17
Text can be formatted in a number of ways using the 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 highlight colour * Make text smaller * Embolden * Italicise * Format as a numbered list Align left Align Centre Indent text Emphasise *
Choose background colour * Make text larger * Underline * Format as a bulleted list Align right Justify Outdent text 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.
16
Nvu Warning. With Nvu 1.0 when using Strict Doctype check 'Use CSS styles instead of HTML elements and attributes' in Tools > Preferences > General to ensure availability of all options.
17
Nvu
3.4.4 Lists
To start a list from scratch 1. 2. 3. 4. Click one of the list buttons (Numbered List or Bulleted list) on the Format toolbar. Type the first item. Press Enter and type the next item. To finish, on the last (blank) item press Enter
To change existing text into a list 1. Select the text required. 2. Click one of the list buttons on the Format Toolbar. The text will be changed into a list a new item starting for each paragraph or other block item encountered. To add items to a list 1. Click at the end of the last item in the list. 2. Press Enter and type the new item. Numbering and format will continue from the previous item.
18
Nvu Each level of list in a nested set may have either the same or different format which may be set as above. Nvu sets no format by default. Browsers normally by default render all numbered lists with decimal number format but each level of bulleted lists using a different bullet symbol.
The options offered include indenting text. Those unfamiliar with web design may look, in vain, for a tab option. HTML does not support tabs although the List feature does produce a tabbed effect. Nvu substitutes for this in that pressing the Tab key introduces several spaces of course these do not produce the alignment effects that real tabbing would. The spaces introduced by the Tab key are technically known as non-breaking spaces. Pressing the space bar more than once also introduces non-breaking spaces.
19
Nvu
By special characters we refer to characters which do not have an equivalent keyboard key. HTML uses a system of characters known as 'Unicode'. This includes a large range of characters including all the international currency symbols and many thousands of others, though the fonts supplied on computers will support only a subset. A number of the more common, including accented ones, may be inserted using Insert > Characters and Symbols. Nvu does not directly support smart quotes but text which has been copied from applications like Microsoft Word or OpenOffice.org which include smart quotes will retain these details and they will be correctly rendered in browsers. If you need a character which is unobtainable by these methods there are several alternatives available. 1. Using the Windows Character Map Find, copy and paste a character. 2. Directly from the keyboard while pressing the ALT key input a zero followed by the three digit decimal code for the character. This code is shown for a number of characters at the bottom right of the Windows Character Map. 3. By editing the file in Source view. See section 3.16. Characters may be inserted either using the decimal code for the character or using a mnemonic entity. Precede the decimal code with &# and the entity with & and follow both with a semicolon. Use no spaces. The HTML specification (see appendix 2) in section 24 lists the codes. Some useful examples are shown in the box. There is more on special characters in appendix 6 sections A6.3.7 and A6.3.8
20
Nvu
21
Nvu Acquiring dictionaries Dictionaries may be available from a variety of sources one of which is at http://dictionaries.mozdev.org/installation.html Dictionaries are formatted with xpi extensions. To acquire a dictionary first identify a source. Then 1. 2. 3. 4. 5. Open the source page in a browser. Right click on the file. Click 'Save link as'. Navigate to a suitable folder (any will do) Click 'Save'.
To install a new dictionary 1. 2. 3. 4. 5. Click Tools > Extensions > Install. The 'Select an extension to install' window opens. Navigate to the location where the xpi file has been saved, select it and click 'Open'. The 'Software installation' window opens. Click 'Install now'.
When the Spell Checker is next called the new dictionary appears in the drop down list. [I am grateful to Greg and Elenora on the Forum for much of the above detail.]
22
Nvu To insert an image 1. Click the 'Image' button on the Composition toolbar. 2. The Image properties window opens. Click 'Choose File' and browse and select a file 3. Click Open. Leave checked the box URL is relative to page location this will allow you to move the page and image to another location, as you will have to when you upload them to a server. (If you de-select this and move the page, it will try to find the image at the original location.) Note If the box is greyed out this is probably because the page has not been saved. 4. In the box labelled Alternate text add a description of the image. (This forms the alt attribute for the image and provides text which will appear in place of the image with user agents (browsers) that cannot display images (screen readers and voice synthesisers). It will also be used by those with visual impairment. The content of this box must be carefully considered so as to be of maximum assistance in such cases.) Note Where the image is purely decorative, and not necessary to understanding the page, alternative text is not required and should be omitted. 5. In the box labelled Tooltip you may optionally insert a Title attribute for the image. Some browsers will show the text provided when the cursor hovers over the image. 6. Click OK.
23
Nvu Try the various options. The text starting from where the image is inserted will wrap around the image. You may prefer the complete paragraph to wrap. Click on the image and drag the cursor to the start of the paragraph, or anywhere else. Moving images is easy! You may find the first three options confusing. They refer to the position of the text relative to the image NOT the image relative to the text. Specifically you will find no way of putting an image in the middle of the page with text wrapping around it. Note This type of presentation, common enough in print, is almost impossible to achieve using HTML even with full use of styles. You may decide that the image is too close to the text, that you would like more space around it. Again Image Properties allows this. On the Appearance tab set Spacing Top and Bottom and/or Left and Right as required. You can also put a border of selected width around a image. The border will be the same colour as the adjacent text. An alternative way of aligning an image is to apply a style via a class as explained in sections 4.2.1.4 and 4.2.3.
1.
On the Composition Toolbar click the Table button. The Insert table window appears. 2. Leave the Quickly tab selected and drag out a matrix then click the bottom right cell to define the table arrangement.
24
Nvu 3. The cells appear on the screen with narrow outlines. Note If later the table border is set to zero these outlines disappear but Nvu in normal view replaces them with a red outline. This does not appear in Preview or in a browser. Tables have resizing boxes similar to those used with images. Alternatively for more control 1. On the Composition Toolbar click the Table button. The Insert table window appears. 2. Click the Precisely tab. 3. Specify the number of rows and columns required. 4. Specify the width of the table either in pixels or as a percentage of window size. 5. If a border is required around the table enter the width in pixels otherwise enter 0. If a border is specified each cell will also have a border but narrow. Note CSS styles give fuller control of borders. See section 4.2.1.3. For more options Right-click the table and select Table Cell properties'. The Table properties window opens. This has two tabs 'Table' and 'Cells' which allow overall control of several aspects of either the table or individual cells. This includes a. b. c. d. e. f. g. Alignment of text within cells Wrapping of text Cell spacing - the gap between cells Cell padding - the gap between the edge of the cell and the text within it. Size of table and cells. Background colour Selection of cells as 'Normal' or 'Header' (Cells which are headings to rows or columns should be selected as 'Header'. Normally this results in them being rendered in bold type.)
Nvu width unspecified. This is likely to result in the best presentation as the browser will set the width to the optimal value. To adjust table size, with the cursor in the table, click the table button (or double-click the table). In the Table Properties window select the Table tab. The width can be set either as a percentage of window width or in pixels. To leave it unspecified clear any number in the width box. It is possible to adjust the size of a table using the sizing boxes. When you do this the size is specified in pixels.
3.6.2.2 Colouring, adding deleting and merging cells, rows and columns
Right-Click in a table or cell and several menu options appear which allow the table or cell to be formatted as desired. Some of the options are context sensitive. Table or cell background color allows the colour of the complete table or any cell to be set. Table Insert provides means of adding rows, columns, individual cells or even tables into a cell. Table delete provides the opposite. A cell can be joined with the cell on its right, thus merging two cells. Virgin cells cannot be split but joined cells can. If adjacent cells (whether within a row or column) are selected together they can be joined.
Each cell, when clicked, reveals a set of six manipulation symbols (triangles and circles with x inside), these provide a rapid method of inserting or deleting rows and columns of cells as shown in the figure. Setting the cell background colour for adjacent cells to a dark colour reveals gaps between the cells. This may be convenient if the cells are to be filled with text as it avoids two items of text abutting each other. At other times it is a problem. The gap is controlled by the Cellspacing attribute.
26
Nvu
27
Nvu The Table Properties window also allows the padding to be set. Padding is the distance between the cell content, e.g. text, and the edge of the cell. This provides an alternative way of establishing space between the content of adjacent cells. Padding applies to all four edges of a cell and to all the cells in a table. Once again use a style for fuller control.
Right-click on table and select Table Cell Properties. Use Table button to open Table Properties window. Right-click in table and select Table or Cell. Background Color.
Double click a table Click a table and click the table button Right click anywhere in a table and select Table cell properties.
Tables and cells can be re-formatted in many ways. This means that you dont have to plan everything in advance before you start your table as settings can be adjusted later.
28
Nvu The table properties window provides an option to insert a caption which can be positioned on any edge. For those familiar with them, the Advanced Edit button gives direct access to inline styles.
29
Nvu
3.7 Links
Links provide the main means of navigating web sites. They allow you to move quickly from one place to either another on the same page, a different page on the same site or a page on an external site. Links may be attached to any element on a page, in fact almost any part of a page content can form the basis of a link an element being generated specifically for the purpose. Usually however we use a few words of text or an image which we click on to activate the link.
30
Nvu In Normal or Preview mode you will now find your text underlined and in a different colour (probably blue) You can now try double-clicking on the text, you will see the 'Link Properties' pop up again. This can be very useful if you want to change the file to which the link refers. (In a browser you would expect the file viewed to be replaced by the one to which the link refers!) If you now switch to 'HTML Tags' view you will see your text preceded by a yellow marker with an 'A' in it. Your text has been defined as an 'A' (Anchor) element.
31
Nvu Note If your page is short you may not notice this. You need to test with a long page with the link towards the bottom and the anchor towards the top. With most browsers the anchor should be sit on the top visible line.
While these probably appear in different colours it is the browser which determines this. Note For Transitional doctypes Nvu offers a means of altering the colours via Tools > Preferences > New Page Settings. All new pages should use the new selections (they dont affect the currently open page). A better way to gain full, reliable control is to clear Use custom, colors and set link colours using styles. See section 4.2.5.2.
32
Nvu To create a link 1. Click on the image 2. On the Composition toolbar click on the Link button, alternatively Right click and select Create Link. The 'Image Properties window opens. 3. Click on 'Choose File' and browse to the file that you want to link to. (The box URL is relative to page location is checked. This means that if you move your page to a new folder you should move the image to a corresponding new folder. If you clear this box the absolute address of the image on the hard drive is given in full. If you move your page now it will look there for the image. As you start to organise a web site you will find that this is not a good arrangement and potentially disastrous when you upload the page to a server.) 4. Click OPEN. 5. Click OK
3.8 Frames
If you dont know what frames are read no further youll be no worse off. Nvu does not support frames at least not at present. If you open a frame document, you get a message This page cant be edited for an unknown reason but it displays the frame content rather beautifully. Then you can do nothing with it except click on the Source tab. You then see the source code and the system will seem to lock up. Actually it doesnt lock and you can load another page and revert to normal operation. This is not a great limitation. Though the code for frames takes a little getting used to it is usually quite short and can easily be produced using a text editor. Once established it probably rarely needs to be altered. You can use Nvu to develop the pages that go into the frames. Frame-like presentations can be simulated using CSS.
http://www.nvu.com/demos/frames/frameSimulate.html
provides useful guidance which works well with Mozilla type browsers but less well with Internet Explorer.
3.9 Forms
3.9.1 Introduction
Forms provide a mechanism by which a visitor to a site may send data to as sever for processing. This may be as simple as a box to write a message for e-mailing or as complex as looking up items from a catalogue and sending an order to a supplier. Forms collect data 33
Nvu typed in or collected from check boxes or lists and pass them to the server. It follows that forms can be used only in association with compatible software running on the server. Forms may be placed on standard web pages and act as block level elements. In normal view Nvu shows forms surrounded by a dotted cyan box. Forms may contain other standard block level elements (paragraphs, headings ) as well as several specific elements known as form controls which are designed for data collection. Since these form controls are essentially inline elements they must be laid out inside block level elements (typically paragraphs though divs would be equally suitable). Each item of data sent to the server is tagged with information about which control has sent it. This is done by naming each control. Thus designers must give a unique name to each control to be used. The data collected by a form will be sent to a URL specified in an element action which Nvu will add to the form. This URL is often on the server that hosts the web page but does not have to be. The data will be processed using one of two methods known as GET or POST which also need to be specified. These details will be available from the provider of the associated software.
34
Nvu
3.10 Layers
3.10.1 What layers are
One of Nvus 'Tip of the day' says Did you know that you can move elements? Just place the caret in the block youd like to move and click once on the Layer button to make the block movable. Items forming layers are taken out of the normal document flow and placed in positions defined on the page absolutely e.g. in positions fixed relative to the page boundary. While layers introduce a level of flexibility to page design they also involve complexities that newcomers may wish to avoid. This section is therefore for those who wish to delve further.
The block becomes a Layer. Layers have sizing boxes which allow the size to be altered. At the top of the layer is a positioning handle (denoted by a four-way arrow) layer click and drag the handle. . To move the
Layers do not have to consist of a single block any sequence of elements that can be selected together can be converted into a layer. This may be several paragraphs with or without headings, images and tables. Layers allow items to be placed on a page so that the absolute position, relative to the page, is defined. This provides a facility common in drawing and desk top publishing programs and allows items to be overlaid on top of each other. As such it is a very powerful tool. Text items normally have transparent background so when overlaid become confused. By formatting them with a background colour they become solid. Similarly tables with solid background and non-transparent images may be overlaid on each other to produce clear effects.
35
Nvu
Layers in Nvu are contained in div elements. (For more on div see section 4.5) Layers break out of the normal flow in which each block follows the previous and precedes the next. Layers, as created by Nvu, have defined width so do not accommodate to narrowing or widening the viewing window. Layers do not however have defined height so will accommodate to changes in text size selected in the browser. Layers, as created, are characterised by three parameters top, left, and width. These define, in pixels, how far the top left hand corner of the layer is from the top left hand origin of the page and how wide the layer is. Layers may be manipulated using the buttons on the Format (2) toolbar.
When positioning layers so that they overlap a mechanism is needed to define which is in front (so entirely visible) which behind (so partially obscured). Two buttons (Bring to front and Send to back) on the Format (2) toolbar take care of this. Select the layer and click the appropriate button.
36
Nvu
Layers, as created, do not have a property z-index allocated. When brought to the front a zindex with value =1 is attached. The z-index defines how far forward the layer is. If another layer is to be brought to the front of the first it needs z-index to be set to 2. Selecting it and bringing it to the front however merely sets the index to 1. By repeating the process the index is set to 2 and the layer brought further forward. Note The buttons would be more appropriately labelled Bring forward, and Send back.
3.10.5 Gluing
Six other buttons on the Format (2) toolbar can be used to modify the behaviour of layers. They are
Glue to the left border Glue to the right border Stay in the center Glue to the top Glue to the bottom Stay in the middle
Clicking the first (Glue to the left) initially has no effect since this is the default condition. If clicked after some conflicting condition was set it fixes the distance of the left hand side of the selected layer from the left edge. Glue to the right fixes the distance of the right hand side (rather than the left hand side) of the layer from the right hand edge. Glue to the center defines the position, not in absolute terms but as a percentage of the available width. Thus, if created at the centre of the space, it will remain in the centre, similarly for any other ratio. Glue to the top also represents the default condition otherwise it fixes the distance from the top of the layer to the top edge. Glue to the bottom and Stay in the center are best avoided by other than advanced users who will probably be using style sheets to achieve the effect required.
Nvu To do so, in HTML tags view, right-click the DIV tag for the layer and select Advanced properties, Inline style. It is instructive to note which properties are applied to achieve each effect. Gluing option Initial Property width top left right bottom Left Center Right Top Middle Bottom Values given to property position absolute absolute absolute absolute absolute absolute absolute px px px px px px auto px px % auto px px auto px auto auto px px px px px % px px auto px
Offsets Bottom px or %
By using a class further options become available which cannot be achieved by using the toolbar buttons. The position selector provides options of Absolute, Relative, Static or Fixed. The fixed option is used in the HTML version of this User Guide to position the menu. The layer remains in a fixed position on the screen, not scrolling. The effect is similar to that attainable using frames for a web site. Warning Internet Explorer version 6 interprets fixed as is it were 'relative' so though it displays initially in the correct position it scrolls instead of remaining fixed on the page.
38
Nvu
3.11 Borders
Elsewhere a number of methods for applying borders to images and tables have been mentioned. The level of control possible has varied from case to case and the use of style sheets to gain full control has been referred to. There is one further method which is very easy to apply and which is applicable to all block level elements e.g. Table (and/or cells), Image, Heading, Paragraph, Form. The method uses the full border capabilities of CSS which provides complete control of
Colour of the border Thickness (width) of the border Style Solid, dotted, dashed, double etc. Different choices for each side
The method does not cover other options which are sometimes available elsewhere e.g. Padding.
To apply a border select a block and click the Borders button. Note The Borders button is not installed by default. To access it customise the Format Toolbar. See section 9.3 Leave the check box ticked and set the style, width and colour for the top border. If all borders are to be the same click OK otherwise clear the box and edit the settings for the other sides. Note Borders can be applied in more than one way. If you click in a block the border is applied as described. If, in HTML tags view, you select the block marker the block is placed in a div and the border is applied to the div. If, in any view, you select more than one block they are placed in a div and border applied. (For more on div see section 4.5.)
Nvu 3. Make the desired selections and click OK. The Inline Styles allows you to set several other properties for the whole page. This includes Text, Border and Box properties. This can be a quick way of styling a whole page since Text properties, for instance, will trickle down (technically they are inherited) to everything on the page for which they are not otherwise specifically stated. Border and box properties are not inherited. Stylesheets (see section 4.4) often set several general properties for the body to avoid having to repeat them several times. Inline styles may set the body width to be less than the full window width. In this case it may be desired to centre the page in the window. To centre a page in the window 1. On the Status bar click the <body> marker. All the contents of the page will be highlighted. 2. Right-click and select Inline Styles and Box properties. 3. In the Width box select the width desired for the page. 4. In the Margins area in both Left and Right boxes type auto. 5. Click OK. Note Pages created using Nvu using Transitional doctype will not centre as described when viewed using Internet Explorer. This problem does not occur when using Strict doctype or with pages created using KompoZer. See also Doctypes supported.
40
Nvu If the headings in the page do not provide a satisfactory structure for the ToC it is possible to include short paragraphs specifically for this purpose. These may be included at any level in the ToC. The selected paragraphs are identified by applying a named class style (section 4.2.3) generated for the purpose (unless fortuitously pre-existing). Alternatively a <div> (section 4.5) to which a named class style has been applied may be used. Generating and using a ToC in this way has the considerable advantage that it can be automatically maintained ensuring that changes to the page are accurately reflected. A ToC works only within the page in which it resides. Links to other pages must be entered and maintained manually.
The Table of Contents will be created. Note The box Make the table of contents read-only does not work. To update a ToC after changes have been made to a page. There is no need to place the cursor. 1. 2. 3. 4. Click Insert > Table of Contents > Update. The Table of Contents window appears showing the selections previously made. If desired, changes may be made to the selections. To update the ToC click OK.
To delete a ToC. There is no need to place the cursor. 1. Click Insert > Table of Contents > Remove.
41
Nvu
3.13.3 Methods
Nvu builds the ToC using Ordered or Unordered lists. (section 3.4.4). These lists have to be nested to produce the structure required. The result is that each level of the contents is indented relative to the previous. The indentation may be altered using styles and specifying the OL or UL and LI elements. The changes required will be to the margin and padding (section 4.2.1.4). Any changes made will apply to all lists on the page (not only ToC). In order to make links work, each tag listed in the table will have a named anchor added automatically when the table is created or updated. Deleting a ToC also deletes all these anchors.
Items dependent on the Doctype as set when creating the page (section 3.2.1). Items collected from Page Preferences (section 9.1). Includes Author, Language. Items set by the Format > Page Title and properties menu. Includes Title, Author, Description, Language, Writing direction Character set. Links to stylesheets (section 4.1.3.3) Definitions for internal styles (section 4.1.3.2)
Nvu provides four ways of viewing a page 'Normal', 'HTML Tags', 'Source', 'Preview'. These are selected using the tabs on the Edit mode Toolbar. All provide full editing facilities.
Preview mode offers almost the same view as in a browser with the addition of rulers and sizing boxes. The main differences are that scripts do not run (so their effects will not be seen), links do not operate and the style for links does not respond to any class set. Tooltips do work however.
42
Nvu
Normal view is very similar but here table outlines show and markers for named anchors appear. HTML Tags view assists those familiar with HTML.
There is a yellow marker for the start tag for all elements (end tags are omitted). Clicking on a marker selects and highlights the whole of the element. Note If clicking an element does not select it press the control key while clicking. You will also see the element highlighted on the Status Bar (see figure). If you switch to Source view the element remains highlighted, Note It will be on the screen but possibly right at the bottom. This is of great assistance in editing. Marker names correspond with the HTML tag name with a few exceptions. Note Named anchors are shown with a symbol whereas linked anchors are denoted by 'A', The marker 'Span' is used when certain changes are made inline with text for instance if the colour is changed for a single word. Span in HTML has a more restricted use being confined to changes implemented using styles. This may be confusing. In HTML Tags view background images do not appear.
Source view shows all detail of the HTML code. All except the DOCTYPE may be edited.
An additional view is provided via the Browse button. This opens your default browser and gives full browser functionality and display to a page. Warning If your default browser is Internet Explorer the page may open in source view instead of page view.
43
Nvu Nvu provides some options in how lines are displayed as mentioned in section 9.2 on Preferences or see Nvu Help.
Simply place the cursor anywhere in a block. This is often sufficient where a format is to be applied to a complete block. Double-click within a block to select a word. Triple click within a block to select a line of text. Drag across a section of text to highlight and select that section only.
Many functions may be carried out on the selected text this includes
Dragging to a different position, Applying a class Changing the element tag e.g. changing from a paragraph to a list.
Selecting in HTML tags view Sometimes selections in normal or preview mode become difficult or impossible.
In HTML Tags view press the Control key while clicking on the tag for the block to select a complete block.
Actions appropriate to complete blocks such as dragging or applying a class are possible. Selecting via the Status bar This is a quite excellent tool. Click in any text object or image, then, on the Status bar, click on the element marker farthest to the right. The object is selected. To the left of this are shown any elements higher in the document tree. Click any of these to select the corresponding elements. KompoZer also displays the class or id of each element allowing for easier selection. Double clicking This provides a powerful context-sensitive function which often provides the fastest route to appropriate actions.
44
Nvu
Double click an image to reach the 'Image properties' window which allows changes to image location, name, size, link etc. Double click a link or anchor to edit the name, properties etc. Double click a table or cell to access properties such as size, colour, alignment. Double click most things to obtain access to 'Advanced properties' via the 'Advanced edit' button which appears on the first window to open. While these require more detailed knowledge of HTML or CSS they can be used to apply extensive formatting options to items.
45
Nvu
4
4.1
The use of styles is already well established in word processing and desk top publishing. In web site design it assumes an even more important role and can control almost every aspect of presentation. Styles in HTML documents should comply with the requirements of the W3C style specifications. These are detailed in Cascading Style Sheets, level 2 CSS2 Specification which is available at http://www.w3.org/TR/CSS21/. A full introduction and many useful references may be found at http://en.wikipedia.org/wiki/Cascading_Style_Sheets
4.1.1
Power of styles
Styles specify how particular elements on a page appear on the screen, in print or whatever. This guide limits itself to on-screen considerations. By elements we mean parts of the page structure, typically headings and paragraphs, but also stretching to many others including tables, bulleted and numbered lists etc. In fact most HTML Tags may be specified though the same style may be applied to several. Style may typically define such aspects of presentation as the font face, size and variant, the font colour, the background colour, whether an element is to be aligned right, centre or left, whether spaced away from other elements, surrounded by a box and, if so, what type or colour. Elements may be given an absolute position relative to the page (which allows elements to overlap). Elements such as paragraphs, tables and images are considered to exist within boxes or blocks and the sizes of these boxes may be specified. Note You can see the outlines of the blocks by selecting View - Block outline.
4.1.2
Classes
As well as allowing you to specify the style of elements it is possible to define styles and apply them selectively to only some elements. This is done through Classes a Class is just a style that can be applied as and when you choose. Classes are applied to Tags (a marker attached to an element). The element to which the class is applied appears in the format defined by the class. Other similar elements without the class applied appear in the default format i.e. either the default specified by the browser or the style that the user has defined for the corresponding element.
4.1.3
Using style
46
Nvu a style is listed in the code (in Source view) with the tag to which it applies (using the structure style = . if you look at the code). Dont worry Nvu hides all this from you. If you have another item with the same style this code must be repeated. This bloats the page. This is known as an inline style. For the most part Nvu users do not have to be concerned with this method although Nvu will sometimes use it without you knowing.
47
Nvu need to edit this line manually. As we will see later KompoZer simplifies this process greatly. See section 4.2.4.1
4.2
4.2.1
Creating styles
Internal styles
Styles are created and edited using the built in Style sheet editor called CaScadeS (in KompoZer KaZcadeS). CaScadeS has two modes of operation Beginner Mode and Expert Mode. When it opens it opens in expert mode, should you wish to switch to Beginner Mode clear the check box. The difference is that in Beginner mode External style sheets cannot be created. When internal styles are created Nvu will include the the rules for these in the 'head' area of the document. Using Nvu To start creating styles: 1. 2. 3. 4. Open Tools > CSS Editor. Click 'Style elt', Create Stylesheet. Click RULE. The General tab opens and offers the options Named Style or Style applied to all elements of type or Style applied to all elements matching the following selector.
48
Nvu 6. In the box type p, or the tag for the element (without the quotes) 7. Click Create style rule. Using KompoZer To start creating styles: 1. Open Tools > CSS Editor or on the toolbar click the 'KaZcadeS button. 2. Click the arrow to activate the drop down list. 3. Click RULE To style an element e.g. a paragraph:
1. 2. 3.
4. In the box labelled 'Selector' type p, or the tag for the element (without the quotes) 5. Click Create style rule. In the pane on the left you should see a structure showing each tag as it is defined. Versions of KompoZer later than 0.77 will probably use the technique as described for Nvu. To define how you want elements to look: 1. Click the tag for the element in the left hand pane. The General tab should show, listing the Selector (at present the element tag) and any style Declarations (initially blank). 2. Now select in turn as required the tabs for Text, Background, Border etc and specify exactly how you wish that element to appear. The next section amplifies some details of how to do this. 3. Return to the general tab to see the full declarations that you have set for the Selector. I wont go through all the options, just mention a few. First, do note you are not obliged to specify any particular properties. You specify as much or as little as you wish. Its just that the browser will revert to defaults if you dont. There are fairly complicated rules for what it uses, and browsers dont always follow the rules, however chances are that youll be happy with whatever it does if youre not change it! You may like to try setting declarations for the body and apply it to all elements. In most cases declarations specified here with trickle down to everything else (they are inherited) unless you specify it explicitly elsewhere. Generally this works but can generate surprises. Style Nomenclature Styles employ a bespoke nomenclature. Nvu uses this little since, except in source view, the code is hidden from the author. The terms involved do appear in this User Guide. Here they are along with some examples. The examples show the source code that would appear either in the head area of your page or in an external style sheet.
49
Nvu p { font-family Simple rule with one declaration : Arial, sans-serif ;} p { font-family : Arial, sans-serif Rule with 2 declarations ; font-size : medium ;} h1 , h2 { Rule with 2 selectors color : #990000 ;} .redtext { color Rule with class selector : red ;} #menu li a:link { text-decoration Rule with complex selector * : none ;} Key: Rules appear within a blue bordered box Declarations have a dashed border Selectors have a red border and white background Properties have a green border and white background Values have a magenta border and white background
50
Nvu * This selector selects list items in the div with id 'menu' and which are linked. Note The tabs available on the CSS editors allow a large number and all the most important style properties to be set. The CSS specification however includes many others. Note Users familiar with these who are using KompoZer can type declarations manually into the box (incorrectly) headed 'Style rule'. On closing the editor the validity of the declaration will be checked and those which are valid will be added to the stylesheet. Apparently as a consequence of the above, it is not possible to edit an internal stylesheet in source view when using KompoZer. Any changes will be ignored.
In common parlance font families are referred to as fonts. CSS always refers to them as font families. The correct typographic term is Typeface. (The English word for font is fount but sadly the American word has come into general use in the UK.) Unspecified leaves everything to the browser Predefined has a drop down selector offering one of three choices. Each choice has a set of 3 fonts which have fundamentally similar characteristics. The choices are:
Sans serif proportional fonts. Serif proportional fonts. Fixed spacing fonts.
Each set has three entries. The first two are alternative similar fonts; the third entry is a statement of the generic font type the browser should look for the first font listed, if it cant find it, look for the second and, if that cant be found, use a font of the generic type of the final entry. Thus something suitable will always be found. See Warning below when using this option. Custom font family is an option to be avoided or used with extreme caution. The list offered is taken from the fonts installed on the author's computer. If you choose one which is not available on your visitors computer there is no control over what will be used. On the other hand, if carefully used, this option is very flexible and you can build your own set using the model from the Predefined selector. To build a set of fonts. 1. Note the structure of the Predefined sets. The lists are built with each font name terminated by a comma and each set finished with a generic type.
51
Nvu 2. Select a generic type from the following: serif, sans-serif, cursive, fantasy, monospace. 3. Select preferred fonts corresponding to the generic type required. 4. With the Text tab selected check Use custom font family and in the box type the name of your preferred fonts each followed by a comma, finish with a generic type. Note 1 You will probably wish to include one font available on Windows PC systems and an equivalent available on Macintosh computers. Note 2 You may enter as many fonts as you wish. Note 3 Using cursive or fantasy options is not recommended since the level of standardisation between visitors will render the results very uncertain. Note 4 If you use a font which has a name which includes spaces (such as Times New Roman) the name must be enclosed within quotes e.g. "Times New Roman". If you fail to do this the result will probably still work but validation will fail. Warning Unfortunately when Nvu builds sets of fonts itself it fails to do this. The fixed spacing option presents no problem but the two proportional options use fonts with spaces in the font names. Authors must either suffer the indignity of failing validation or edit the style values in source view to overcome the problem. Font size. There are three sections offering different types of option. The first block is a miscellany offering various units. Because display screens vary in size and resolution and because peoples eyes and preferences differ, browsers offer view options allowing the user to alter the text size. If this facility is disabled the user may not be able to see the page as he or she would wish. Some of the options in this first group (e.g. px, pt, cm, in, mm, pc) either apply to print media or are for fixed size units. These may disable browser zooming or result in unpredictable sizes. You will probably find the last set of named styles (starting xx-small) is most satisfactory, alternatively use the percentage or em scales. As you select and alter the size you can see the result directly on your page. Absolute and relative sizes. Text in Division. Size not specified - Inherited. Text in table. Size not specified. Inherited from div.
Size for this cell set to 120% Text in a second table Text size for table set to 120% Size for cell not specified inherited from table.
When setting font sizes for text lying directly in the body element 1em, 100% and 'medium' generally yield identical results. Font sizes are inherited so text in elements which themselves 52
Nvu sit in the body will, unless specified separately, use the same sizes. Elements may however sit, not directly in the body but, within other elements such as a table or a division. Where such a table or division has a font size set on itself this may be inherited by text within that table or division. For instance, if a div has font size set to 150% and a paragraph within the div has font size set to 1em then the text will actually be rendered at 1.5em due to it inheriting the scale from the div. Note A division is formed using the <div> element. See section 4.5 An example of how this can work is given in the adjacent figure. Text sits in table cells, which sit within a table which sits within a division. One of the tables and one of the cells has font size specified. Others do not. Not all sizes scale in this way. Sizes set as a percentage or in em or ex do scale and are referred to as relative sizes. Sizes specified using the xx-small system do not scale and are referred to as absolute sizes Note All sizes will zoom using the browser text size options with the exception of sizes specified in pixels. In this case browsers vary in response. Font Colour. Either enter a colour into the box or click on the button to the right. If you click on the button the Text Color window opens and you have three more options. (Its like buying an ice cream in the USA or making a phone call in the UK.) You can specify in terms of Hue, Saturation and Brightness (HSB), Red, Green Blue values (RGB) (range 0 to 255). Alternatively click on one of the 70 boxes of colours offered. These are so-called web safe colours because they work on lower performance displays. Actually the full range of 216 web-safe colours is not provided but, in any case, modern displays normally work in at least 24-bit colour so there is little justification for this limitation. The next option is to click on the rainbow type area. Whichever you choose, the selected colour appears immediately on the square. Fine adjustments may be made using the RGB or HSB values. A box labelled Hex value shows the colour as a hexadecimal number. Actually you could have done this directly without opening the Text Color window when you close the window youll see the hex value (preceded by a #) in the box along with a sample of the colour on the button. Named colours. Youre welcome to skip this note but there is one other method! You might have noticed, as you clicked on one of the 70 colours, that occasionally in the box labelled Name the name of a colour appeared. (Try black or red to check.) The CSS recommendation recognises 17 colours and the names of these can be entered directly here, or, in fact, into the selector box without entering the Text Color window. The valid names are aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white, and yellow. Other text options These appear below the colour option and are fairly self-explanatory.
53
Nvu
4.2.1.3 Border
Items can be bordered and the options available provide great flexibility. Styles, thickness and colours may be set independently for each side. Note For a border to show both width and style must be specified.
4.2.1.4 Box
The block structure in which most elements are located has already been mentioned (section 3.4.1). The Box options control the display within these blocks. For those boxes which require a dimension to be entered: first type the number, then select the unit from the drop down box. Margin Controls the distance between the elements box, i.e. where any border would be, and either the surrounding box or adjacent boxes. Note Vertical margins collapse. If a heading has a bottom margin set to 20px and is followed by a paragraph with a top margin set to 10px the separation between them is controlled by the greater (20px) not the sum (30 px).
Padding Controls the distance between the box content and its border.
54
Nvu Width and Height Allow a specific size to be allocated to the content area of a box. This can be an absolute width or a percentage of the containing box. Float allows blocks to be treated rather like images and to float them to the right or left hand side of a page (or to the edge of the enclosing block). Other elements may therefore appear to wrap around them. Position, Offset and z-index are parameters related to the use of layers. These have been covered in section 3.10.6
4.2.2
Instead of setting styles for one element at a time it may be easier to specify several at the same time. Perhaps all your headings are in one font (e.g. serif) and all others in an other (sans-serif). You can specify h1, h2, h3, h4, h5 and h6 as serif font in a single action by listing them and separating by commas after selecting RULE, Style applied to . Later you can specify, for example the size of, each heading individually in a separate rule.
4.2.3
Named Classes
Ive suggested above that you start by applying styles to all elements of a specific type. Such style definitions will apply automatically wherever that element is found on a page. This provides for great consistency within a document but maybe a touch of dullness! You can also define your own styles and apply them selectively. These styles are known as Classes. Note Class names can contain letters, numbers and underscores but not spaces and must not start with a number. They are case insensitive. N.B. Class names do not include the initial dot. Using Nvu To create a class 1. Open the CSS Editor, and if necessary create a style sheet, as described in section 4.2.1 2. Click on the stylesheet to select it. (If there is more than one stylesheet click on the one in which you wish to create the class.) 3. Decide on a name for the class. 4. Click on RULE, leave Named style selected and enter your chosen class name in the box. 5. Click on Create style rule. You should see the name of your style appear in the pane on the left but note that the name is preceded by a dot (full stop). Using KompoZer To create a class 1. Open the KaZcadeS CSS Editor, and if necessary create a style sheet, as described in section 4.2.1 2. Click on the stylesheet to select it. (If there is more than one stylesheet click on the one in which you wish to create the class.) 3. Decide on a name for the class. 4. Click the drop down arrow (by the Palette icon) and select RULE.
55
Nvu 5. In the Selector box enter a dot immediately followed (without a space) by the class name. 6. Click on Create style rule. You should see the name of your style appear in the pane on the left but note that the name is preceded by a dot (full stop). Note Versions of Kompozer later than 0.77 will probably use a method closer to step 4 and 5 described for Nvu. Now proceed as in section 4.2.1 To define how you want elements to look. In that case you could watch the effect of your styles appear immediately on your page (assuming that you had a page which used the corresponding elements). Now, of course, you have none, so first we must learn how to apply a class to an element. First enter some details for your new class that will allow you to recognise it on the screen if it is applied. For instance use the border tab to produce a border styled as solid, 2px wide, coloured red. It is possible to set styles for several classes at the same time just as it was for elements. Proceed as in 4.2.2 but precede all class names by a dot e.g. .style1, .style2 (Nvu automatically adds the dot for the first).
Nvu provides two methods for applying classes. Method 1 is the simpler; sometimes it is difficult to select the item to use this method in which case method 2 is preferable. Apply a class - Method 1 1. If necessary close the CSS editor. 2. Select the item to which the class is to be applied. For a heading or paragraph simply click in the text, to apply a class to an inline section of text (span) highlight the text. 3. Use the class selector box on the Format toolbar (see figure), click the drop down arrow and select the class required. 4. The result of applying the class should be seen in any view mode. Note Although Nvu is not a browser it replicates the browser display very well. However styles applied to links are not rendered correctly. 56
Nvu Apply a class - Method 2 Note This mode cannot be used to create the span element needed to style an inline section of text but can style such a section once the span exists. 1. If necessary close the CSS editor. 2. EITHER in 'HTML Tags' view Click on the yellow marker for the element for which you want to set a class. (If the element does not become selected, as indicated by outlining or highlighting on the screen, press the control key while selecting.) OR in Normal or Preview mode click in a block you wish to style then click on the Status bar on the right-most element listed. 3. Now both the block involved and the corresponding element and on the status bar should be highlighted. (See figure above.) 4. Right-click the highlighted element on the status bar and select Classes. You should see a list of all classes pop up (This includes classes on internal and linked stylesheets.) Any class already applied to the element appears, marked with a tick (), at the top of the list above the divider line; other available classes are below the line. 5. To add a new class, click the class; To remove a class, click the class above the divider.
Note Elements can actually have several classes applied. If you do this you should ensure that the class properties dont conflict with each other. Most people will probably prefer to apply only one class at a time. You may need to check that you dont apply more by mistake.
4.2.4
External styles
There are three ways to start working with external style sheets
To create an external style sheet 1. Open the CSS Editor. (Tools > CSS Editor or in KompoZer click the KaZcadeS button). 2. Make sure that you are in Expert Mode and Click Style elt. 3. Type a title in the box and click Create Stylesheet. 4. Click Export Stylesheet
57
Nvu 5. Give it a name with extension css and save it, preferably in the same folder as your page. Now click on RULE and you should be on familiar territory. When we created internal styles they were entered on our page in the HEAD section. Now the styles are being created in an external file. If you looked, in Source View, in the head area you would see a line referring to the external file and linking it to your page. Warning Nvu users. Unfortunately Nvu makes a meal of inserting the filename. It puts the absolute address of the file as it appears on your hard drive. When you upload or move your page the stylesheet wont be found. You will need to edit the HTML Source code in the line starting <link rel="stylesheet" (note the line, which may spread over several lines, finishes type="text/css">) Delete all the code like file:///C:/Documents%20 right up to and including the / before the filename. The result should contain text like href="filename.css". If your stylesheet is in a sub-folder the text should be like href="subfolder/filename.css". KompoZer users KompoZer 0.77 makes the fix required much easier to achieve. Run the markup cleaner (Tools > Markup Cleaner) with 'Relativize local URLs' checked and the source will be corrected for you. It is probable that later versions of KompoZer will make the correction automatically without any author action.
58
Nvu You can now close the CSS editor, but, of course you can work on the stylesheet in the usual way. NB the same warning applies as in section 4.2.4.1
4.2.5.1 Introduction
Element styles (section 4.2.1) and named classes (section 4.2.3) are the two main selectors used for styles. A selector may be thought of as the link which attaches a particular style declaration to a particular item on a page. Note Strictly the class selector consists of the class name and a prefixed dot. In addition to these the CSS specification provides a large range of more complex selectors most of which lie outside the scope of this Guide. For details see the CSS Specification section 5. (See appendix 2.) There are however a few cases which are needed more frequently and for less complex sites and these are covered in the next two sections.
for all links not yet visited for links that have been visited for a link over which the cursor is hovering
Note The following procedures are based on the use of internal style sheets. Very similar procedures may be used with external stylesheets.
59
Nvu 2. At step 4, if using Nvu select Style applied to all elements matching the following selector and, in the box enter the selector as listed above. 3. At step 5 the selector name should appear as entered. It is now possible to style these options fully, i.e. not only with text colour and decoration but with background, boxes, the lot. Note that the a:hover must be placed after the a:link and a:visited rules, since otherwise the cascading rules will hide the a:hover rule. The CSS editor enters styles in the order encountered. The order may be altered by selecting an item and clicking the Up or Down button. Warning in Nvu 1.0 the Down button is disabled. Using KompoZer both buttons work correctly. Note These styles will now be applied to links automatically. They do not have to be applied manually as do classes.
textarea textarea
label fieldset legend
4.2.5.4 ID styles
Ids (or Unique identifiers) havent been mentioned so far and I wont explain fully. They can be used for several purposes though support in Nvu at present is limited. Since an id is a unique identifier it can be used once only (on any page). Most commonly ids are used in conjunction with the div element to mark a particular area on a page such as a table of contents, a menu or some such. It is helpful in such cases to give the id a name which indicates its use. To create a style based on an ID
60
Nvu 1. Select a name for the id. This must follow the same rules as for a class. See section 4.2.3. 2. Proceed as if creating a stylesheet and styling an element (see section 4.2.1). 3. At step 6 enter the name of the ID preceded by the number sign e.g. #menu. To apply an ID While, in principle, ids are similar to classes it is not possible in Nvu to apply an id via the class selector box but the method is still easy. 1. If necessary close the CSS editor. 2. Click in the div to which you wish to apply the id. 3. On the status bar click the <div> tag. If there are more than one, select that furthest to the right. Both the tag and the content of the div should be highlighted. 4. Without moving the cursor right-click and select 'id'. 5. From the pop-up list select and click the id required.
4.3
Removing styles
The CSS editor allows you to remove styles in a similar way to adding them. In the Sheets and rules pane select the rule you want to remove and click Remove. Similarly you can remove a stylesheet. Select the sheet and click Remove. If you select an internal stylesheet it is deleted from the file completely. Warning this deletion is not reversible using Undo. If you remove an external stylesheet the link on the page is removed irreversibly but the external file is left intact.
4.4
Inheritance
A web page has a hierarchical structure e.g. text in a table cell sits under the Table. You see some of this structure in HTML Tags view. Inheritance means that style properties set at a high level in the structure e.g. at Body level will be applied at lower levels unless specifically re-specified. So a font family set the Table element will be applied to everything in the table but if you include a paragraph in the table and set a different font for the p element then that will be applied. Section 4.2.1.1 has already shown a small demonstration of the effect. Inheritance is very useful as it allows properties to be set once in a style sheet rather than having to be applied to every element that you want to use that property. You will have to consult a detailed specification (such as appendix F Full property table of the CSS2.1 specification) to see what is inherited and what is not but, in general, you can assume that all properties are inherited except things like Background, Border, Margin, Padding, Width and positioning.
61
Nvu
62
Nvu A common use of divs is for unique regions of a page. Examples might be a menu, a table of contents or the main text area. In such cases rather than applying a class to a div it is more appropriate to use an 'id'.
These may be set up in the same way as for pseudo-classes see section 4.2.5.2.
63
Nvu
Scripts
Scripts are short programs that are included in HTML documents (and consist of alphanumeric and other characters) which can change the presentation of pages in some way. Scripts must be written in an appropriate script language but this does not form part of the HTML specification. Support for scripting language depends on the browser and/or server employed. The most common scripting language is probably JavaScript. It runs on the browser and most modern browsers provide support but this can sometimes be disabled if desired by the visitor. Another common script is PHP. This runs on and depends on support provided by the server. When including PHP code authors should use the fuller tags e.g. <? php ?> and not the short tags <? ?> which Nvu does not support. Nvu allows the use of scripts on pages but does not respond to them. The effect of the script will not be seen on the Normal, HTML Tags or Preview view (but the code will of course appear in Source view). To see the code at work click on Browse. Note Some scripts include 'special characters' which, when encoded by Nvu, result in errors when the script runs. To avoid this, in Tools > Preferences > Advanced, check the box 'Don't encode special characters in attribute values'. You can find more in formation about this in Appendix 6 The Insert menu does offer one piece of JavaScript, a calendar. When you click it nothing appears to happen until you save and run your file on a browser when the calendar appears!. In the menu there is a command Tools > Web Development This Guide does not cover this. Note If your page refuses to save after inserting the Calendar widget use the Save as command.
64
Nvu
Inserts
The menu command Insert provides several options. Image. See section 3.5.1. Table. See section 3.6.1. Form. See section 3.9. Link. See section 3.7. Named anchor. See section 3.7.1.3. Horizontal line. Inserts a horizontal line across the width of a block at the point selected. This doesnt have to be in the simple default style you can define a class and apply it to customise the line. Alternatively the Horizontal Line Properties (double click on the line) allows the width and height, alignment to be set. Colour can be set via the Advanced Property editor using the Inline Styles tab and setting a value for background-color. HTML. Allows you to insert some hand-coded HTML code at any point on a page. (If you want to add code in the HEAD area youll have to use Source view instead.) Note If you wish to insert HTML into your page this is probably the safest way to do so. While you can still make mistakes in the code Nvu will carry out some checks and ensure that the result is valid HTML (whether or not what you intended). Editing in Source view (see section 3.16) can cause massive corruption of your page. Characters and symbols. Provides a wide range of characters not readily available from the keyboard including accented and copyright. There is more about special characters in Appendix 6. Table of contents. Inserts a table of contents, based on heading styles which can be selected. The table entries are linked to the corresponding headings. See section 3.13. Smart Widgets. Provides a small selection of novelties (A calendar and Made with Nvu If youre proud of your design and that fact that Nvu helped you why not use it.) Templates. See section 7. PHP Code Clicking opens a window into which PHP code may be typed or copied. On closing, the code along with the required php tags is added to the source code. Note Nvu does not support short tags like <? ?> . Comments are commonly used by coders in order to improve maintainability of code. Comments do not appear on a page. Nvu helpfully displays an exclamation mark in viewing modes other than preview which when hovered over reveals the content of the comment.
65
Nvu Break below images. If you have an image aligned right or left (with text wrapping around it) this command breaks the wrap at the point selected, the text continuing below the image.
66
Nvu
7 Templates
7.1 What are templates?
Templates are basically pages having some content (eg a letter head) which can be re-used to create other pages which will have the same underlying page structure and, often, the same graphical layout. Templates are not altered in use and can be used over and over again. The simplest template is probably a blank sheet which links to a stylesheet for use throughout a site. More common is a page which has a banner and perhaps a menu to appear on every page. Last might be a complete page layout for use on all, or many, pages of a site but which includes areas for customising individually. Templates may be considered as having two parts the fixed part or boilerplate which remains the same for every page and the editable part which changes. KompoZer recognises two types of editable part. Block and flow. Block items are like any other html block and may consist of paragraph-like items or divs (which may contain several blocks). Blocks may be made repeatable - so that several similar items may be added if required. Flow items will be contained within other block items in line with the text, for instance to change one or two words in a paragraph.
7.2
Templates are prepared and edited using KompoZer just like any other page. To create a template 1. Click File > New then select A blank template and Create. Note All templates will be created with the Transitional HTML Doctype. 2. Add any content which is to appear on all pages based on the template. 3. Format this in the normal way.
67
Nvu 4. If the formatting is to be based on a style sheet prepare this in the normal way as detailed in section 4.2.4. Note For this to be successful the template must first be saved. 5. Add the areas which are to be made editable. Fill these in using dummy text so that a complete page layout is achieved even though some of it may be meaningless. Format this as required. Note Useful dummy text can be found at http://www.lipsum.com/. Note There are other approaches to page layout but the method described is simple and reliable. The first figure shows a page prepared as described.
7.3
Saving templates
To save a template 1. Click File > Save or File > Save As. The extension mzt will be selected automatically.
7.4
1. 2. 3. 4. 5.
7.5
The content of the page - boilerplate and examples of editable content - should already be set up and formatted.
68
Nvu
To make blocks editable 1. 2. 3. 4. 5. In turn, select each block that you wish to make editable. In HTML tags view select the block by clicking its tag. On the status bar right-click the corresponding highlighted tag. Click Templates > Make editable. In the Insert an editable area window give the block a recognisable name. Now check the options boxes if required.
Note The option Area is optional allows it to be deleted easily when the page is in use. Area is repeatable allows copies to be made rapidly. Area is moveable turns the area into a movable layer (see section 3.10). Warning In KompoZer 0.7.10 this option is disabled 6 Click OK.
To make a flow selection editable 1. 2. 3. 4. 5. In turn select (highlight) each section of text that you wish to make editable. Click Insert > Templates >Insert editable area. In the Insert an editable area window give the block a recognisable name. Leave checked the option Flow of text. Check the options boxes if required as described above.
Note The option Area is moveable is inappropriate for flow areas). 6 Click OK
When you have finished save the template as described in section 7.3 The second figure (above) shows a template at this stage. It has one non-repeatable block item - The program name, Two non-repeatable flow items - The Date and Language, Two
69
Nvu repeatable flow items - The Changed areas and Other languages; the second of these is optional.
7.6
Using templates
To base a page on a template first ensure that the template itself has been saved and closed a page cannot be based on an open template. Note All pages which KompoZer creates which are based on templates are created as HTML documents using the Transitional doctype. It is not possible to create XHTML documents or those with Strict doctypes from templates. To create a page 1. Click File > New > A new document based on a template > Choose File. 2. Select the Template (Note templates have the file extension mzt) 3. Click Create. The page that appears carries
Boilerplate items Labels for the editable areas within coloured rectangles (with rounded upper corners) Sample text (same as the labels) within surrounding editable boxes (with dashed borders).
70
Nvu To use the page Warning - At KompoZer 0.7.10 the text for repeatable items cannot be edited at this stage, however copies may be made for editing later.
1. Click in turn in each editable areas. 2. Select and delete the sample text and replace it with new text. 2a If the editable area was repeatable a small square appears within the label, hovering turns it red and clicking makes a copy. Copies have small circles which act as delete buttons. The third figure (above) illustrates the template with one flow item (the Changed areas) repeated once. The first three items have the text replaced. 2b If any area was optional a small circle with an x appears within the label. Hovering turns it red and clicking deletes it. The same figure shows this for the 'Other languages'. Because of the limitation described it has not been possible to fill in all the editable areas. 3. When all editable boxes have been completed detach the page from the template by clicking Edit > Detach from template. The page now assumes its final appearance. 4. Save the page in the normal way. The last figure shows the final result. The areas which could not be edited earlier have been completed. Now it is possible to edit any item and as a workaround the frozen repeatable items may be added.
7.7
Editing templates
Templates which have already been saved may be altered after opening using menu commands File > Open File and selecting Files of Type then HTML Templates. Note The default opening setting is HTML Files which will not open templates.
71
Nvu
8
8.1
Site Manager
Overview
The site manager allows you to navigate your site or between sites easily. To toggle the Site Manager on or off either press F9 or use View > Show/Hide > Site Manager. Site Manager can deal with sites irrespective of whether they reside on a local machine or on a remote server. In the latter case, if you are on a dial-up network, Site Manager will dial and make the connection for you. Since generally you will set up a site on a local machine and later 'publish' to a remote server we will deal first with setting up on a local machine. Site Manager provides a directory tree view of a site similar to the view with Windows Explorer. It however lists only directories which you have specifically set up as Sites. You can set up many sites, they appear in Site Manager irrespective of where they appear in a normal directory tree.
8.2
Setting up sites
To set up a new site (assuming that pages for the site have already been created) open Site Manager, click Edit Sites. This opens the Publish Settings window.
72
Nvu Choose a convenient name for the site (You may like to call it something like My Site Local to differentiate it from a later My Site Remote) and enter it in the box Site Name. In the Publishing server area click Select directory and browse to the folder where the site is located, select the folder and OK. The box should read something like file:///C:/Documents .... (Ignore the hint line which applies to remote sites only.) Leave the other boxes (Web site information, User name etc.) blank. Back in Site Manager in the column headed Name the new site should be listed and can be expanded to show its contents.
8.3
The main window lists all sites which have been set up and, for any sites which have been expanded, the files contained in it. (See figure.) Double-click any site to expand it. At the top of the Site Manager window a drop down box allows you to view all files or to select to view only html files (which includes htm files) or only image files (these include gif, jpg, jpeg and png files). For files it is possible to display the file size and modified date. To select or de-select these options, in the column heading click the right-most division and select the options required (see fig-ure). (You may have to widen the site manager window to make this possible.) It is not possible to change the order of the listing.
Double click on any html file to load it directly to the page area for editing. By using the buttons at the top of the Site Manager window, and selecting a file if required, it is possible to rename and delete files and to create folders. Note all these actions alter the actual files concerned. By using the Edit Sites function and the Publish Settings window, sites may be removed from the Site Manager but this has no effect on the actual folders or files involved only on the view in Site Manager.
8.4
Remote sites
Remote sites on the server hosting a site may be set up in almost exactly the same way as local sites (see Section 8.2). This permits the same browsing, display and editing functions as for a local site.
73
Nvu This time all the boxes on the Publish Settings window must be completed. Hints are provided for the content of each. The HTTP address will be used by the Site Manager to find the site. Warning Remember that any firewall in place must allow Nvu to access to the site. Unfortunately Nvu provides little help in resolving any problems which arise while setting up sites.
74
Nvu
9
9.1
Setting preferences
Preferences
You can set up a number of features in Nvu according to personal preferences. Several of the options are grouped under the Tools > Preferences menu. In addition you can customise toolbars via the View > Show/hide menu.
Defaults
Authors may be satisfied by the Nvu default settings however in a number of cases this User Guide recommends different settings. Although you are at liberty to make changes those made inadvertently may cause problems. The table lists the default settings for Nvu and KompoZer, in case you wish to revert, along with my recommended setting. Menu selection Maximum number of pages Retain original source formatting Reformat HTML Source Save images when saving Tools > pages Preferences Always show publish > General dialog Maintain table layout Use CSS styles Always open a document in a new tab Allow documents to use Tools > other fonts Preferences > Fonts for others see text Author Reader's default colors Tools > Background image Preferences Language > New Page settings Writing direction Character set Tools > Preferences > Advanced Set up Proxies Markup - Language Markup - DTD Nvu default Kz Default Recommended 10 10 10 Cleared Checked Checked Cleared Checked Checked Checked Checked Checked Cleared Cleared Cleared Checked Checked Checked Checked Checked Cleared Cleared Cleared Checked Checked Checked Checked
Blank Checked Blank Blank No direction ISO-8859-1 Direct connection HTML 4 Transitional
Blank Checked Blank Blank No direction ISO-8859-1 Direct connection HTML 4 Strict
Blank Checked Blank Blank No direction ISO-8859-1 Direct connection HTML 4 Strict
75
Nvu Return in paragraph always Checked creates new Underline misspelled Checked words HTML4 Output the following Special characters characters Don't encode '>' outside Cleared attribute Don't encode special Cleared characters
Checked Checked Only & < > and non Cleared Cleared
Checked Cleared Only & < > and non- Cleared Cleared
General group
Retain original source formatting The options Retain original source formatting and Reformat HTML source alter the display in Source view but have no effect when viewed in a browser. Retain original source formatting results in code which is very compact but very difficult to read in source view. Reformat HTML source introduces changes designed to improve readability such as indenting levels in table structures. Unfortunately each time a file is edited a number of new line characters are added to the file which gradually grows in size. This becomes obvious when the page source is viewed in a browser but will not be seen in Nvu source view. They are otherwise completely ignored by browsers and have no effect on the rendering of a page. Which option is selected is largely a matter of personal preference and way of working. Save images and other associated files when saving pages. When saving a file to a new location using 'Save as ..' if this box is checked the images and style sheets will be saved to the same folder as the page. This may be useful occasionally but, where a site is structured with different kinds of files in different folders, that structure will not be preserved. Warning. Not only will the files not be copied to the file structure specified in the source file but the new saved file will be altered to reflect the new (flat) structure. If you wish to use more complex structure on your site, checking this box will inflict considerable damage to 76
Nvu your file necessitating a lot of rework. The original file in the original location will however remain as designed. Always show publish dialog when publishing pages
If checked, Nvu always displays the Publish Page dialog box when you Publish a page. If not checked, Nvu only displays the dialog box if it needs more information in order to publish the page.
Fonts
In the absence of a definition of the font to be used a browser will make a choice on some basis built in to the browser. Nvu acts in the same way and this area allows customisation of the choice made. If the box 'Allow documents to use other fonts' is checked Nvu will use the font specified in the style or other means. If the box is unchecked Nvu will not respect styles and will use a font from the list specified on the upper part of this window.
The boxes specifying sizes and screen resolution appear not to work.
77
Nvu Language - The main language for the page should be set to facilitate use by automated tools, for instance speech synthesisers. Many languages offer regionalisation alternatives, either select one of these or use the generic. Writing direction Usually this may be left at the default of 'No direction specified'. Setting the language defines the writing direction. Character set - Normally for western languages leave this set to the default of ISO-8859-1. If in doubt set to UTF-8. You can find more about choice of encoding in Appendix 6. Note This is badly entitled. It should read 'Character encoding'. Though it sets a 'charset' parameter it dos not define a character set.
Advanced
Set up Proxies - For most people click 'Connection settings' and check that 'Direct connection' is checked. if you need to set up proxies refer to Nvu Help. Markup - The Markup language and doctype may be set as desired. I have recommended the use of Strict HTML. Note Properly this should be included under New page Settings. NB It does not alter an existing page. Return in paragraph always creates new paragraph - The action of the Return (Enter) key in or at the end of text objects is described in the following table. Return in paragraph Box checked Box cleared New paragraph New line Return at end of paragraph New paragraph New line Return in heading New heading New heading Return at end of heading Body Body
When the box is checked it is possible to create a new line in or at the end of a paragraph or heading by pressing Shift + Enter. When the box is cleared it is possible to escape from a paragraph by pressing the Return key twice. This creates a new paragraph but also leaves a line break at the end of the previous paragraph. Most people will prefer to leave the box checked. The action of the return key in other circumstances depends on the context, for instance in a table cell it generates a new line, in a list it creates a new list item. Underline misspelled words - When set this is a useful reminder to poor spellers or typists who forget to run the spell checker separately, however it consumes resources which may slow the system, in particular the time taken to switch between views may become excessive. It is usually better to clear this setting.
78
Nvu Output the following characters as entities - In normal use this should be set as recommended. No setting will damage a file but other settings are intended for use only during development of pages. Don't encode '>' outside attribute - Set as recommended. Don't encode special characters as entities - Set as recommended.
9.3
Toolbars
Buttons on Composition toolbar
New file Open file Save file Publish Browse Insert or edit named anchor
Insert or edit Insert or edit Insert or edit Check Spelling Print page Image table Form
Justify text
Indent text
Outdent text
Stay in middle
79
Nvu
Cut
Copy
Paste
Find
Right to left
Borders
Customising Toolbars
The list above shows the buttons, and the corresponding icons, available on Nvu toolbars. The buttons are normally located on the toolbar indicated. A button may not be installed by default in which case the bar may be customised to make it available. You can view or hide a number of the toolbars. On the Menu Bar select View > Show/hide then check which toolbar you wish to display. You cannot hide the menu bar. You can customise some toolbars to change which items appear on them. To do so right-click on the bar and select Customize then drag an item to or from the toolbar. As you customise a toolbar you can select whether you wish to display small or large icons. This selection is specific to each bar. When customising toolbars three additional symbols will be found. Separator provides a vertical bar to separate sections on a toolbar, Space provides an invisible space of fixed size. Flexible space provides a space which will expand to fill any space available.
Menu alternatives
Since the Composition Toolbar is often the simplest way of carrying out a function this guide has generally assumed that buttons available for that bar are visible. If you have disabled the Composition or Format toolbar or a button, functions may be still accessed via the Menu bar. The corresponding selections are shown in the table opposite. If there is a shortcut key (with control key) it is also listed.
Button
Anchor Align center Align justify Align left Align right Bold Browse
Insert > Named anchor Format > Align > Center Format > Align > Justify Format > Align > Left Format > Align > Right Format > Text style > Bold File > Browse page
80
Nvu Bulleted list Choose color for text Choose color for background Choose highlight color for text Copy Cut Find Form Horizontal Line Image Indent text Italic Larger font size Link New Numbered list Open Outdent text Paste Print Publish Save Smaller font size Spell Table Underline Format > List > Bulleted Format > Text Color n/a n/a Edit > Copy Edit > Cut Edit > Find Insert > Form Insert > Horizontal line Insert > Image Format > Increase indent Format > Text style > Italic Format > Font size > Larger Insert > Link File > New Format > List > Numbered File > Open File Format > Decrease indent Edit > Paste File > Print File > Publish File > Save Format > Font size > smaller Edit > Spell checking Insert > Table Format > Text style > Underline
C X F
] I + L N O [ V P S K U
81
Nvu
10
Publishing
10.1 Introduction
Publishing a site means transferring the site, i.e. the pages, images and stylesheets involved, to a web server from which they may be accessed, usually but not necessarily, by the public. This process is called Uploading. Prior to publishing there are a few checks which should be carried out.
10.2
Validating simply means checking that the page or site operates as intended. Designers may by now have a plethora of files some of which are obsolete or are not required for the published site. A good practice is to create a new folder structure and in it place those files, and only those files, which are needed. This can be done using your usual file manager e.g. Windows Explorer but the Nvu File Manager can be set up to do this task by Publishing these to a new folder.
10.2.1
Markup Cleaner
Nvu provides a Markup Cleaner Tools > Markup Cleaner which can be used to remove redundant code which clutters the file but does not contribute to the page content. This does not necessarily remove all redundant content but makes a good contribution to it.
10.2.2
Browser testing
The next stage of validation has already been taken care of by Nvu. Users have a high assurance that the code generated represents valid HTML or CSS. The site should next be run using a browser. Possible problems include you having omitted to transfer files to the correct folders, naming the folders incorrectly, including getting the case wrong. It is also possible that, when you linked stylesheets, Nvu used absolute addresses instead of relative addresses (see section 4.2.4.1). Sort these problems out first. Tip. Those having access to only one computer running Windows XP may like to know that they can run several versions of Internet Explorer on it. Joe Maddalone developed the method and Yousif Al Saif has produced an installer. At time of writing it does not run on Windows Vista. The site should be checked on a range of different browsers. Several modern Mozilla based browsers behave very similarly so do not provide additional confidence. Check with browsers from other sources and be very conscious that a few visitors may still be using very old browsers. In mid 2007 a minimal set of browsers to test on might be Firefox (latest version), Opera (latest version), Internet Explorer 6 and Internet Explorer 7. Both these latter two behave differently from each other and also from other browsers so use both. In spite of the 82
Nvu availability of Internet Explorer 7 version 6 remains the most widely deployed so it is essential to check with this.
10.2.3
Formal validation
Browsers are often very tolerant of incorrect code. A much more rigorous test is to submit pages to the W3C validators. There are two: one checks that the page code conforms to the HTML specification, the second that the style sheet (internal and external linked) code conforms to the CSS specification. Nvu provides direct access to the first of these. To validate a page. Open it in Nvu. On the Menu choose Tools > Validate HTML. A validator window opens and the page is automatically submitted for validation. The result will be displayed in the window. To validate pages with internal stylesheets or separate external stylesheets the validators may be used independently. The URLs are given in the References (Appendix 2). Pages may be validated either from the local disk or after the files have been uploaded. While the W3C validators check rigorously for conformity with specifications this does not guarantee that the code will run correctly. Unfortunately none of the current browsers fully support the specifications! This is why browser validation is an essential step.
10.3
Publishing
You can publish your web pages to a web server on which you have an account. Your ISP probably offers limited free space but you can buy space from professional hosting providers. To publish a site you need to know the settings for the space so that you can set up your system. Files may be uploaded using any available FTP program but Nvu has built-in facilities which are integrated with the Site Manager which makes this task very simple. While uploading using Nvu is simple the facilities and the folder structures supported are limited. You may prefer to use one of the available open source or freeware FTP programs.
10.3.1
While setting up Site Manager you may already have configured the remote site (sections 8.4 and 8.2), if not, either proceed as detailed there, go directly to Publish Settings via Edit > Publishing Site settings.
83
Nvu
In the Site names box enter the name that you want to know the site by. HTTP address (URL) of your site. From your ISP (see hints). Publishing address This is the ftp address to which you will publish. User name From your ISP. Password From your ISP. If you wish to, check Save Password.
If you have several sites set up and you have one site that you always or usually publish to you may wish to click on the name of this site then Set as default. This simplifies uploading. Click OK.
10.3.2
Uploading
Open the page that you want to upload. An easy way to do this is from the Site Manager. 1. Click the PUBLISH button. 2. On the Publish Page window on the Publish tab, if it is not your default, in the Site name box select the site to which you want to publish. The Page title and File name should already be completed. 3. If the page is to be uploaded to a sub-directory, rather than the root directory, enter the name of a sub-directory and any of the other data if required. Note This directory must exist. Nvu cannot create it. 4. If it is the first time to upload the page and if it includes images or uses external style sheets check the box Include images and other files. (If it is not the first time and these other files have not changed the box may be left unchecked.) The files will be placed in the same directory as the page. If you want them to go in a sub-directory check the box Use this site sub-directory and name the directory. In this case the directory will be created if needed. Note this is a sub-directory of the root directory not any directory detailed in the previous point. If you want to use such a directory this must be explicitly detailed e.g. pagesubdirectory/filessubdirectory/ Note all the Images and style sheets will be placed in the same directory. This is the only arrangement supported by the Site Manager Publisher.
84
Nvu 5. You should not need to refer to the Settings tab as the data should be collected via the Site name you have selected but you may view the data and change if you wish. 6. Click Publish. A Publishing window will appear and uploading will commence. (If you are on a dial-up connection this will be connected.) 7. Within a short time you should receive confirmation of correct publication similar to the first figure above. 8. One possible source of problems occurs if you are prevented from accessing the site by a firewall. In this case you may receive a Publishing failed message similar to that shown in the second figure.
The Troubleshooting button takes you to the Nvu help system but this is short of aid in this area at present. Other possible problems include
Some required files are missing File or directory names incorrect e.g. Wrong case
Once you have published a page, if you need to publish it again, your settings (e.g. subdirectories) should be remembered by Nvu. You will not see steps 2 to 4 again unless changes have been made to the page.
Cest fini !
85
Nvu
Appendices A1 Glossary
This Glossary defines terms as used in this document. As far as possible, when terms used also occur in the HTML or CSS specifications, they have the same meanings as in those specifications. In such cases more precise definitions may be obtained there. ASCII American Standard Code for information Interchange. BMP Basic Multilingual plane. Button A small picture, or icon, which when clicked results in an action. Nvu buttons are of various shapes. CaScadeS The CSS editor that comes with Nvu. CSS Cascading Style Sheets. Declaration The second part of a style rule. Contains format details of the style. Deprecated A feature marked as deprecated is one which is considered obsolete, and whose use is discouraged. Generally CSS provides better features. Transitional Document types allow the use of deprecated features. (The Strict type does not.) Directory Equivalent to what Windows calls a folder. Doctype Document type Declaration - see appendix 3. DTD Document type Definition - see appendix 3. Element A small part of a web page such as a paragraph or an image which can be manipulated by a browser in ways determined by the code associated with the element. Extension The final section of a filename (after the dot) indicating the type of file. FTP File Transfer Protocol. Used to transfer files to a server. Handle Symbols, usually small squares, on the edges of sizing boxes which, when clicked, allow the size or position to be dragged. HTML HyperText Markup Language. The publishing language of the World Wide Web. ISP Internet Service Provider. KaZcadeS The CSS editor that comes with KompoZer. Later versions are using the name CaScadeS
86
Nvu KompoZer A 'Bug fix version of Nvu. See introduction. Mozilla I use the term to refer to a number of similar browsers including Netscape 6 and later, Mozilla and Firefox. MSIE Microsoft Internet Explorer. The browser from Microsoft Corporation. Non-breaking space A space character which, though invisible, acts as a normal character in that a word which includes a non-breaking space will not be split to wrap a line. Nvu The open source software package (pronounced N-view / envju: /, for a new view) available at http://www.nvu.com, on which this guide is based. Selector The first part of a style rule. (May be thought of as the name of the rule.) Sizing box A box, denoted by small squares, (Handles) which in Nvu appears around some items when clicked. See also Handle. Strict see Deprecated. Stylesheet A text file, that may be a part of the page in use, that describes the position, appearance or behaviour of some or all of the html elements of which the page consists. Some terms used in developing stylesheets are explained in section 4.2.1 Tab (window) Part of many window structures which emulate the tab on a paper filing system designed to give quick access to part of the file. If a tab is clicked a new display will appear within the same window. Tab (key) The keyboard key intended to emulate the action of the tab key on a typewriter. Tag A piece of code in a web page associated with an element. Typically each element has a start tag and an end tag. Tags include the element name and are surrounded by angle brackets. E.g. <p> and </p>. UCS Universal character set. Upload (ing) The process of transferring web files from a local computer to the computer which will host them on the web. URL Uniform Resource Locator. The web address of an item. W3C World Wide Web Consortium http://www.w3.org A consortium of the 500 biggest IT corporations who got together to define specifications and recommendations so that languages like HTML or CSS can inter-operate without problems on different platforms, devices, operating systems and media.
87
Nvu
A2
References
HTML 4.01 Specification CSS2 Specification W3C HTML Validator CSS Validator http://www.w3.org/TR/html4/cover.html http://www.w3.org/TR/CSS21/ http://www.w3.org http://validator.w3.org/ http://jigsaw.w3.org/css-validator/
A3 Doctypes
A 3.1 Introduction
Prior to version 1 Nvu supported only one Doctype (HTML Transitional). Now users have a choice, so it is necessary to touch on some aspects of this slightly esoteric subject. Doctype abbreviates 'Document type Declaration' which tells a browser which 'Document type definition' (DTD) to use to interpret a page. The Doctype also includes the URL of a file containing the DTD details. The Doctype must appear on the first line of code for a page. Note Actually on an XHTML page an XML declaration may precede this but this can result in problems with some browsers. Nvu does not insert this declaration. Files without an XML declaration use UTF-8 character coding.
A 3.2
Doctypes supported
The Doctypes supported by Nvu are HTML Transitional <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> HTML Strict <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> XHTML Transitional <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> XHTML Strict <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
88
Nvu Note For HTML Doctypes when Nvu inserts a document type declaration, it omits the URL This has the undesirable effect of triggering some versions of MSIE into the so called 'quirks mode'. To set the Doctype for a new file: On the menu bar click File > New and check the appropriate boxes.
smaller files and faster download (Note 1) better layout control better interoperability across platforms, devices and media (Note 2) easier to maintain
Note 1: See Max Design article Why use CSS to separate content from presentation? Note 2: "Experience has shown that separating the structure of a document from its presentational aspects reduces the cost of serving a wide range of platforms, media, etc., and facilitates document revisions." Ref HTML 4.01 specification
89
Nvu Further explanation on why XHTML is not recommended at least at present would go beyond the scope of this User Guide. People who want to know more on this issue are recommended to read the following resources:
Say No to XHTML: an excellent article on misunderstood claims of XHTML at least, on serious misunderstandings about XHTML and problems related to XHTML. Beware of XHTML Another excellent article, worth reading carefully. It has 16 examples and demonstrations showing the issues involved. Sending XHTML as text/html Considered Harmful from Ian Hickson, author of Web Hypertext Application Technology, Applications 1.0. XHTML is dead from Tommy Olsson. XHTML's Dirty Little Secret from Mark Pilgrim XHTML - What's the point? from Henri Sivonen
Even if you are working on an existing document you may consider that it is worth whatever additional work would be required to upgrade to using the HTML 4.01 strict doctype.The benefits of using web standards (W3C recommendations and language specifications regarding web page authoring) are numerous, important, often underestimated and often misunderstood.
Using Web Standards in Your Web Pages is an excellent introduction to this issue which deserves careful study.
90
Nvu Nvu cannot convert from one doctype to another so, if the doctype is not consistent with the code on the page the result will be unreliable. It is because Nvu cannot convert doctypes that I suggest that you continue with the existing doctype when working on pre-existing documents . If you do wish to convert a page it is possible to take content from one document to another with a different doctype by cutting and pasting in normal view. However, when you paste, you must use the 'Paste without formatting' option and reapply all the formats needed. Whether or not you take this option will depend on circumstances.
A4.2 Reinstalling/updating
It is not expected that Nvu will be updated after version 1.0 but you may need to upgrade from an earlier version or possibly to repair a broken installation. Nvu stores a number of settings in files located in the 'Profiles' folder. KompoZer does the same thing and maintains a separate, independent profiles folder. The profile includes:
91
Nvu
Some default settings Details of the sites which you have set up in 'Site Manager' Publishing Site Settings Details of any add-ons installed Your custom spelling dictionary.
The Nvu team recommend that this folder be deleted prior to installing a new version of Nvu. This means that these settings will be lost and have to be re-entered following the new installation. It is advisable to follow this recommendation. The default profiles folder is located at %AppData%\Nvu (i.e. Something like c:\Documents and Settings\<login settings>\Application Data\Nvu). (Similarly for KompoZer.) The procedure for updating is therefore 1. Download the latest version of the program 2. Make sure that you have a record of your Publishing site settings 3. De-install the program in the usual way e.g. From Start > Settings > Control panel > Add or remove Programs. 4. Delete the profiles folder. 5. Install the new version of Nvu 6. Set up Site Manager and Publishing Settings
There are a small number of extensions available for Nvu including alternative spelling dictionaries. Extensions are installed differently from normal programs. the procedure is as follows:
Locate the web page from which the extension may be downloaded Download and save save the extension on your hard drive using the link 'Save link target as'.
92
Nvu
Launch Nvu. Tools > Extensions > Install. Browse to the folder where the extension file is located and select the file. In the window that opens click 'Install now'. Close and relaunch Nvu.
If you have extensions installed you may sometimes wish to run Nvu without the extension. For this you need to have one profile which has the extension installed and one without. Managing profiles explains how to achieve this.
In order to manage profiles you must start Nvu with profiles enabled. To enable profiles: 1. Right click the shortcut icon which you use to start the program. 2. Click 'Properties'. 3. On the shortcut tab 'Target' will show something like "C:\Program Files\Nvu\nvu.exe". 4. Change this by adding a space followed by -p to read something like "C:\Program Files\Nvu\nvu.exe" -p If you use more than one shortcut route you have can set others in the same way. When you launch the program you will now get a window like that shown on the right. You can launch the program from here but you may prefer first to add other profiles.
93
Nvu
To add a profile: 1. Click the 'Create Profile' button 2. Answer the prompts You will be offered the opportunity of giving the profile a more meaningful name. You will also have the opportunity of selecting where you wish to store the files for the profile. If you change this to somewhere in My Documents it may be easier to manage your routine backups. You can also rename and delete profiles as shown in the second figure. Before you add any additional profiles the 'Default profile' will be the profile that you were previously using. It will include all the customisations that you had prepared. Any additional profiles added will be created in a 'virgin' state with none of your history included. You will therefore have to add any site manager and publishing settings that you wish. Because of this you may prefer to set up additional profiles for specific purposes and retain others for more basic functions. [I am grateful to Neil Parks on the Wysi Forum for some of the above information.]
94
Nvu
User Interface
Nvu's interface consists of easily accessible toolbar buttons for all the major functions a user needs to use while designing a web page. With the modern Gecko technology as it base, Nvu offers incredible features like a tabbed interface, extension manager, themes manager, javascript console, etc. With the capability of opening multiple tabs within the same window, you can edit several files in the same instance of Nvu without wasting valuable desktop space and without cluttering the Windows Taskbar or Status Panels. Another feature unique to Nvu is that the status bar shows the tags enclosing the current position of the cursor in real-time giving you a feel of the HTML source while editing the document in WYSIWYG mode. Advanced users can edit the HTML document in Normal, HTML Tags, or Source View modes. The following sections will introduce us to the basic Nvu interface.
Composition Toolbar
The Composition Toolbar consists of buttons used to accomplish common tasks while composing a web page. These buttons perform the functions that you will use most often while creating or editing your web pages. Fig1.1 below shows the composition toolbar (enclosed by a blue rectangle) in its default state. A corresponding list below describes functions of each of the toolbar buttons briefly.
New: Opens a blank document for editing. Clicking the down button besides the New button gives an option of how to open a blank document: in a new tab or a new window. Third option opens a dialog box which allows you to open either a blank document (new tab or new window), document based on a template or a blank template. Open: Opens a file open dialog box where you can choose an already present file for editing. Save: Saves the current document being edited. If the document is being saved the first time, a dialog box is opened, prompting the user where to save the file. Publish: Opens the Site Manager to publish the document to the server which hosts your web pages.
95
Nvu
Browse: Opens the current document being edited in your default browser. This way you get a feel how it will look when users visit your website. If the page is not saved, Nvu prompts you to save the file first and then it opens it in the browser. Anchor: Opens a dialog box to create an anchor. Anchors are the target locations used normally to jump from one place to another in the same page. For example, a document with a short table of contents (TOC) may use anchors for the TOC to allow the user to jump to any section straight away. Link: Opens a dialog box to create a hyper link. You can either put in the URL of a local file, a file on the internet or a named anchor. You can also enter other properties for the link like title text, XFN information, or other advanced properties with the advanced properties editor. See Appendix 1 for details about advanced property editor. Image: Opens a dialog box to select an image to be inserted at the current cursor position. For other advanced settings for the image to be inserted see Appendix 2. Table: Opens a dialog box to select the size of the table to be inserted at the current cursor position. See Chapter 4 for details on inserting and using tables in your documents. Form: Opens a dialog box prompting the user to type in the properties to insert a form at the current cursor position. See Chapter xx for details on using Forms in your documents. Spell: Starts the spell checker to check the spellings of the text you typed in the document. The spell check uses the dictionary you are using (default is US English). Print: Opens the Print dialog to select the printer and print properties before printing your document.
Image:Composition toolbar.png Fig. 1.1 Blue marker encloses the Composition Toolbar. While users can open the composition dialog windows for the Anchor, Link, Image, and Table buttons to create the respective objects on the web page, clicking one of these buttons when the caret is already on the object will open the objects properties. For example, if your caret is in a table, clicking the "Table" button will open the table properties dialog window. Users can thus easily change or add properties for these objects.
Formatting Toolbar
The Formatting Toolbar is located just below the Composition Toolbar. It consists of two rows of buttons, Fig 1.2 and Fig 1.3 shows the formatting toolbar in the default state. Users can also customize it by right clicking on the Format Toolbar and choosing "Customize". Formatting toolbar gives you quick access to the most frequently used text formatting functions e.g. making text bold, italic, underlining text, choosing font face, creating ordered or unordered lists, etc. A more detailed description of each button is provided below:
Choosing Paragraph Format: Choose the paragraph style of selected text. Available options include: o Body Text: Renders selected as unformatted text. o Paragraph: Marks the selected block of text as a paragraph. 96
Nvu Heading Levels 1-6: Marks selected text as a Heading of Level 1,2,..or 6. Address: Marks the selected text as Address format. Address format is in effect italicized text. You will need to add the line breaks in yourself. o Preformat: Marks the selected text as preformatted text. Preformatted text is displayed by the browser as-is. For example, browsers consider multiple white spaces as single white space, but in preformatted text white space is rendered as actually is. Preformatted text is generally used to display code examples. Choose Font Face: With this drop down menu, you can choose the font face for the selected text. The list contains only the fonts installed on your system. It is advised that you use generic font family as the fonts installed on your system may not be available to other viewers. Choose Font Color: Opens the color picker to select the color for the selected text. Choose Background Color: Opens the color picker to select color for background of block of text. Highlight Text: Opens the color picker to select color for highlighting the selected text. Increase Font Size: Increases the font size of selected text. Decrease Font Size: Decreases the font size of selected text. Bold: Makes the selected text bold faced. Italic: Italicizes the selected text. Underline: Underlines the selected text. Numbered List: Starts a numbered (ordered) listing. Bulleted List: Starts a bulleted (unordered) listing. Align Left: Left aligns the selected block of text. Center Align: Center aligns the selected block of text. Align Right: Right aligns the selected block of text. Justify: Justifies both sides the selected block of text. Indent Text: Right indents the currently active block of text. Outdent Text: Decreases the indent of already indented text.
o o
Apply Class to Selection: Apply one of the available classes to selected text. Note: only available if you have a style sheet attached to your document (internal or external). Layer: Encloses the selected text as a layer i.e. an absolutely positioned div. Bring to Front: Brings the active layer in front of the other layers. Send to Back: Sends the active layer behind other layers. Emphasize: Emphasizes selected text. Strong Emphasize: Strongly emphasizes selected text. Definition Term: Converts selected text as definition term. Definition Description: Converts selected text as definition description. Glue to Left Border: Defines left margin (absolute) explicitly for a layer. Stay in Center: Defines left and right margins(absolute) explicitly to keep the layer in center of the window. Glue to Right Border: Defines right margin (absolute) explicitly for a layer. Glue to Top Border: Defines top margin (absolute) explicitly for a layer Stay in Middle: Defines top and bottom margins (absolute) explicitly for a layer.
97
Nvu
Customizing Toolbars
Users can customize the composition and the formatting toolbar according to their liking. Customizing a toolbar allows users to do the following operations:
add buttons to the toolbar from the customization window, remove buttons from the toolbar and put them away in the customization window, and add/remove fixed/flexible spacers to the toolbar create groups of buttons e.g. buttons with similar functionality.
To open the customization window, right-click on the composition or formatting toolbar and select "Customize". You can now drag and drop buttons, a separator, a flexible space or fixed space to the toolbar to add items to it. Or drag items from the toolbar into the customization window to remove items. You can also choose to show only the icons, icons with text or just text in the composition toolbar via the Show drop down menu.
Tabbed Interface
Nvu, like Firefox, has the feature of tabbed interfaces. Multiple tabs allow the user to edit more than one HTML document in the same window at the same time. Each tab has an independent Undo/Redo list, so as to make editing of multiple documents independent of each other. Image:Tabs.pngFig1.4 Tabbed Interface with Saved and Unsaved documents Fig1.4 is a typical screen shot of how multiple tabs look like while editing. For convenience, each tab indicates the state of the document being edited in it. An unsaved document is shown by displaying a "red floppy" icon on the corresponding tab as shown in the second tab in Fig1.4. You can close an individual tab by right-clicking with the mouse on the tab and selecting Close Tab, while the active tab can be close by clicking the "Close" icon on the right end of tabbed interface bar. The tabbed interface also helps users do work more efficiently. You can easily switch from one web page to another by either clicking on the corresponding tab or using the keyboard shortcuts Ctrl+PageUp, and Ctrl+PageDown.
Sample Text
In this tutorial article, we will use the text in the box below. The sample text at present is just plain text. As we go on learning, the text will be transformed using various features/functions of Nvu. For each kind of transformation, there will be a link at the end of the section, which will open the sample text in your default browser with only that transformation applied. The cumulative effect of all the transformations applied to this raw text will be shown at the end of each chapter in a similar box. It would be beneficial if you do the tasks as described in the tutorial along with it. All you will have to do to start along with the tutorial is to copy the "Same Text" section text and
98
Nvu paste it in Nvu. You can just do the same operations that we perform in this tutorial and check if your progress with the HTML document looks the same as the one in the tutorial. Once done, you can start playing around with the various functions in Nvu so that you feel at home when using it. Also, clicking on the "Save" button in the Composition Toolbar every few minutes is a good practice. If you just want to read the tutorial, you will find it easier to view all the sample text at the end of the chapter with all the transformations applied cumulatively. Also, to make it more clear, formatted text will be black in color (or some color other than gray).
Sample Text Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc ac massa non enim dictum vulputate. Vestibulum iaculis. Maecenas nisl magna, suscipit quis, vulputate nec, egestas vel, enim. Ut venenatis blandit elit. Aliquam erat volutpat. Nam eros. Morbi imperdiet, diam at lacinia luctus, diam lacus porttitor quam, a posuere nulla sem vel diam. Suspendisse quam felis, scelerisque vel, fringilla sit amet, commodo quis, orci. Etiam at eros. Aenean facilisis adipiscing libero. Phasellus malesuada sem ornare nulla. Sed sit amet elit. Aenean vel turpis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla rhoncus posuere turpis. Phasellus id ante ac wisi hendrerit bibendum. Etiam a mi. Vestibulum malesuada nisl. Vestibulum eget nulla non quam aliquet mattis. Aliquam molestie lacus sit amet metus. Maecenas sit amet turpis posuere purus cursus cursus. Morbi at sem. Quisque malesuada hendrerit mauris. Cras tincidunt dignissim orci. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Quisque magna urna, auctor consectetuer, tristique sit amet, porta sit amet, dui. Stats Paragraphs 2 Words 168 Bytes 1149 A Numbered List Below we have an ordered i.e. numbered list. Unordered lists can also be made by following similar procedure as that of making ordered lists after clicking the unordered list button on the format toolbar.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed nec velit sit amet dui malesuada porttitor. Fusce auctor turpis ac dui ornare feugiat. Ut et elit ut ante mattis ullamcorper. Maecenas sed tortor at tellus pulvinar commodo.
99
Nvu
Heading Levels
Heading in a document can be used the same way they are used in books, newspaper articles, etc. As you might have noticed, a heading is generally a few words formatted to stand out from the normal text following it. It is advisable to keep heading text short i.e. just a few words. HTML allows 6 different levels of headings, h1, h2, ..., h6. Heading level h1 being the top most and h6 being the smallest. You can also change the default rendering style of an HTML element by using CSS. To format a part of text as a heading, select the desired text (click-and-highlight) and then choose the heading level you want (Heading 1, Heading 2, etc.) from the Body Text drop down menu from the formatting toolbar. The selected text will be formatted according the heading level you selected. The heading of this section is a Heading Level-3 heading, and the name of this chapter is formatted as a Heading Level-1 heading (although text-color has been changed for the chapter title). It is interesting to note the fact that the headings in the sample text are black in color whereas in the tutorial headings are of a navy blue color with a
100
Nvu barcode-like background. This has been accomplished using cascading style sheets. CSS can be used to change the default style of an element as displayed by the browser. Using CSS is an elegant way to separate the content from the design part of a webpage. However, an introduction on how to use CSS would be out of scope at this point of the tutorial. It will be dealt at an advanced stage of the article. You can see the Heading Level-1 in action as applied to section headings by clicking [sampleText-h2.xhtml here]. The Heading Level formatting has been integrated with all other formatting done in this chapter at the end of this page.
Paragraph
Just as there are paragraphs in written text, HTML also allows grouping sentences into a paragraph. Text enclosed in <p> and </p> is treated as a paragraph in HTML. Text markedup as a paragraph is a block-level element and hence each paragraph starts with a new line. To mark a bunch of sentences as a paragraph in your web document, select all those sentences with the mouse (click-and-highlight) and choose the "Paragraph" option in the Body Text drop down menu from the formatting toolbar. Even this paragraph of text has been enclosed by <p> and </p> HTML tags. Our sample text has the first two groups of multilined text marked as paragraph styled text.
101
Nvu While choosing the font face of a section of text, you should keep in mind that when a users visit your web page, the text shown in their web page will be rendered using the fonts they have on their machine. If they don't have a font that you specified in your web document, their browser will use the default font for that particular system to render that particular part of text which may result in a very different design than you see on your machine. So, the best practice is to use a generic font-family as the last option. A generic font-family tells to use the default font for that particular family in case the machine does not have the font you specified. Our sample text has the last line of each paragraph formatted to have courier font face, and if is not available the monospaced font face is used.
Font Color
Changing the color of the whole or a part of text in your document can be easily accomplished by using the "Choose color for text" button. To locate the Choose color for text button, see Formatting Toolbar section in Chapter 1. Image:ColorPicker.pngFig 2.1 Color Picker dialog box To change the color of all or a part of text in your document, select the text (click-andhighlight) for which you want to change the color. Then click on the Choose color for text button. This will open the Text color picker (Fig2.1). Select the color you want for the text either by clicking on the color in the shade-box or typing in the Hexadecimal value of color code e.g. Red = #FF000. Click OK to confirm the changes. A similar procedure was followed to make the text for the first paragraph of our sample text brown in color. While selecting colors for text users are advised to use colors which are easy to read i.e. text color is contrasting enough as compared to its background color.
Nvu A nice example of text highlighting has been presented in our sample text, where the text "numbered list" has been highlighted in a shade of aqua color. To just see the highlighting in action (in your default browser) click [sampleText-hl.xhtml here].
Creating Lists
Several times we need to gather some data or things into a list. Nvu gives us two simple types of lists, viz. ordered list and unordered list. Creating either ordered or unordered list involves the same procedure except the button used to initiate the process. To create the ordered list, click on the Numbered List button on the formatting toolbar (Fig1.2) and to create an unordered list click on the Bulleted List button. For lists with an item and description, use definition lists. After clicking one of the list buttons, Nvu will put the caret in front of a numeric 1, or a bullet depending on which list button you pressed (Numbered for list with 1, 2, 3,... and Bulleted for dark disc shaped bullets). After you type in the text for the current list item, pressing "Enter" (CR), will create a second list item with the caret in front of it. Every pressing of "Enter" will create a new list item. To return to normal text, press Enter once after writing the last list item, and then click the Numbered List or Bulleted List (the button which you clicked to start the list) button again. This will close the list environment and take you back to normal text. Our sample text has an example of a numbered list in the "Numbered List" section. To see just the numbered list formatting applied to our sample text, click [sampleText-list.xhtml here].
Justifying Text
Several times while writing an article or similar text, we want to justify text, either left, right, middle or both sides. With Nvu justifying text is accomplished easily. It is advisable to justify your text paragraph by paragraph, rather than by select the whole document text. This is so because by selecting the whole document text, you are affecting non-paragraph blocks, e.g. lists, tables, etc too. To justify a paragraph, select the paragraph text and click on the justify button which best suits your needs. There are 4 buttons for each type of justification, viz. left, middle, right and both sides. You will find the justify buttons on the right side of the list buttons in the formatting toolbar. The sample text has its first paragraph justified both sides as an example. To see the effects of justification explicitly applied to the raw sample text (1st paragraph justified both sides, 2nd paragraph right justified), click [sampleText-just.xhtml here]. Note: By default any text you type is left justified.
Emphasizing Text
Emphasizing text in a paragraph or an article is one of the ways to make some words or phrases stand out. Nvu can emphasize text in two ways. The first one generates Emphasized (normal) text and the second Strong Emphasized text. Users can find buttons for both of the
103
Nvu emphasis formatting in the second row of the formatting toolbar. The normal emphasize format button is represented with a single quotation mark, whereas the strong emphasize format button is represented with a double quotation mark. Too much emphasizing beats its own purpose. To emphasize or strong emphasize a word or a phrase, select the text with the mouse (clickand-highlight), and then click on the corresponding emphasis button on the format toolbar. You can see the emphasis formatting in action in the sample text, where in the first paragraph each sentence's first word is emphasized, and the second paragraph's first sentence is strong emphasized. To see just the effect of emphasis formatting on our sample text, click [sampleText-em.xhtml here].
Sample Text
Below is the sample text. The text which was formatted with the rules studied above appears black in color.
UNIQ1fee4f37913ae84-HTMLCommentStrip253d9d4c7452197700000001
Sample Text
''Lorem'' ipsum dolor sit amet, consectetuer adipiscing elit. ''Nunc'' ac massa non enim dictum vulputate. ''Vestibulum'' iaculis. ''Maecenas'' nisl magna, suscipit quis, vulputate nec, egestas vel, enim. ''Ut'' venenatis blandit elit. ''Aliquam'' erat volutpat. ''Nam'' eros. ''Morbi'' imperdiet, diam at lacinia luctus, diam lacus porttitor quam, a posuere nulla sem vel diam. ''Suspendisse'' quam felis, scelerisque vel, fringilla sit amet, commodo quis, orci. ''Etiam'' at eros. ''Aenean'' facilisis adipiscing libero. ''Phasellus'' malesuada sem ornare nulla. ''Sed'' sit amet elit. '''Aenean vel turpis'''. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla rhoncus posuere turpis. Phasellus id ante ac wisi hendrerit bibendum. Etiam a mi. Vestibulum malesuada nisl. Vestibulum eget nulla non quam aliquet mattis. Aliquam molestie lacus sit amet metus. Maecenas sit amet turpis posuere purus cursus cursus. Morbi at sem. Quisque malesuada hendrerit mauris. Cras tincidunt dignissim orci. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Quisque magna urna, auctor consectetuer, tristique sit amet, porta sit amet, dui.
Stats
Paragraphs 2 Words 168 Bytes 1149
A Numbered List
104
Nvu Below we have an ordered i.e. numbered list. Unordered lists can also be made by following similar procedure as that of making ordered lists after clicking the unordered list button on the format toolbar. 1. 2. 3. 4. 5. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed nec velit sit amet dui malesuada porttitor. Fusce auctor turpis ac dui ornare feugiat. Ut et elit ut ante mattis ullamcorper. Maecenas sed tortor at tellus pulvinar commodo.
Interesting Links
Nvu.com Mozilla.org Firefox Thunderbird NvuHelp Debian/GNU Linux
105
Nvu
Nvu External links connect your HTML document to other WWW resources e.g. an HTML document (which could be on your own website or a different one), an image, a video clip, etc. To create an external link, select the text you want to appear as the link with the mouse (click-and-highlight). Then click on the "Link" button in the Composition Toolbar. This will open the Link Properties dialog box. Here you can type in the URL of the destination anchor of the link or click on Choose File... to browse to the file you desire to link and then click Open button. The URL can be relative (if it is on your website) or absolute if you are linking to a document on the WWW. Click OK, to make the changes and save the document. Relative URLs are the ones which link to a document on the same website using a relative path. A relative path may start with a ./ or with a ../. The ./ stands for current directory, whereas the ../ stands for one directory up in the directory hierarchy. For example, a link like href="../foobar.pdf" would link a pdf document with the name foobar.pdf which is one directory higher than the current document being edited Image:LinkProperties.pngFig3.2 Link Properties dialog box Tip: Use relative links for images, or other files which you have on your own web site. This makes a transition of website name much easier as all you will need to do change the website name. All relative links will work as the directory structure remains intact. Links generated with the above procedure will look like the ones in our sample text. If you click on the links in the "Interesting Links" section of the sample text, they will open the "destination anchor" in your default browser.
Sample Text
Below is the sample text. The text which was formatted with the rules studied above appears black in color.
UNIQ6178dcc926b361c-HTMLCommentStrip6b184c23131cc2a600000001
Sample Text
''Lorem'' ipsum dolor sit amet, consectetuer adipiscing elit. ''Nunc'' ac massa non enim dictum vulputate. ''Vestibulum'' iaculis. ''Maecenas'' nisl magna, suscipit quis, vulputate nec, egestas vel, enim. ''Ut'' venenatis blandit elit. ''Aliquam'' erat volutpat. ''Nam'' eros. ''Morbi'' imperdiet, diam at lacinia luctus, diam lacus porttitor quam, a posuere nulla sem vel diam. ''Suspendisse'' quam felis, scelerisque vel, fringilla sit amet, commodo quis, orci. ''Etiam'' at eros. ''Aenean'' facilisis adipiscing libero. ''Phasellus'' malesuada sem ornare nulla. ''Sed'' sit amet elit. '''Aenean vel turpis'''. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla rhoncus posuere turpis. Phasellus id ante ac wisi hendrerit bibendum. Etiam a mi. Vestibulum malesuada nisl. Vestibulum eget nulla non quam aliquet mattis. Aliquam molestie lacus sit amet metus. Maecenas sit amet turpis posuere purus cursus cursus. Morbi at sem. Quisque malesuada hendrerit mauris. Cras tincidunt dignissim orci. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. 107
Nvu Quisque magna urna, auctor consectetuer, tristique sit amet, porta sit amet, dui.
Stats
Paragraphs 2 Words 168 Bytes 1149
A Numbered List
Below we have an ordered i.e. numbered list. Unordered lists can also be made by following similar procedure as that of making ordered lists after clicking the unordered list button on the format toolbar. 1. 2. 3. 4. 5. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed nec velit sit amet dui malesuada porttitor. Fusce auctor turpis ac dui ornare feugiat. Ut et elit ut ante mattis ullamcorper. Maecenas sed tortor at tellus pulvinar commodo.
Interesting Links
Nvu.com Mozilla Firefox Thunderbird NvuHelp Debian/GNU Linux
108
Nvu
Creating Tables
109
Nvu After an introduction to inserting images in your web page, we present here another handy feature of HTML: tables. Tables are created in HTML by using the tabular environment tag <table> ... </table>. In addition to the normal use of tables for data tabulation, we can also use tables to position data in our web page, or use table as a base to design columns although it can be done much more efficiently with style sheets. In this section we will concentrate on creating tables for text/images only. To insert a table at the current cursor position: 1. Click on Table button on the composition toolbar (opens Insert Table dialog box Fig 4.2) 2. Hover mouse over table matrix to indicate size of table to insert. 3. Click on the cell below the mouse to create the table of size indicated by selection. Image:InsertTable.pngFig4.2 Insert Table dialog box After creating the table, you can add text, links, images, etc to the table cells. As an example we created a table with 2 rows and 6 columns and copied the links in the "Interesting Links" section of our sample text. Cells in the second row were populated with images related to the links in each cell of first row. Another way of creating a table is by converting selection. In this method, we select the text we want to put in a table and click on the Table button on the composition toolbar (or Table > Create Table from Selection). This opens the Convert to Table dialog box. You can select the character used to separate the selection into columns. The separator characters can be either comma, space, or user defined. Clicking OK will convert the selected text with a table. Each line of the selection is converted to a row in the generated table. The Stats section of the sample text was converted to a table using the Convert to Table method, with "space" as the separator character. To view only the sample text with only the table, click <a href="sampleText-table.xhtml" target="_blank">here</a>. Image:Convert2Table.pngFig4.3 Convert to Table dialog box
Sample Text
Below is the sample text. Unformatted text is greyed out till it has been formatted during the course of the tutorial.
UNIQ6fb16ef84d9386cf-HTMLCommentStrip3fc9096f48f1e8a700000001
Sample Text
''Lorem'' ipsum dolor sit amet, consectetuer adipiscing elit. ''Nunc'' ac massa non enim dictum vulputate. ''Vestibulum'' iaculis. ''Maecenas'' nisl magna, suscipit quis, vulputate nec, egestas vel, enim. ''Ut'' venenatis blandit elit. ''Aliquam'' erat volutpat. ''Nam'' eros. ''Morbi'' imperdiet, diam at lacinia luctus, diam lacus porttitor quam, a posuere nulla sem vel diam. ''Suspendisse'' quam felis, scelerisque vel, fringilla sit amet, commodo quis, orci. ''Etiam'' at
110
Nvu eros. ''Aenean'' facilisis adipiscing libero. ''Phasellus'' malesuada sem ornare nulla. ''Sed'' sit amet elit. '''Aenean vel turpis'''. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla rhoncus posuere turpis. Phasellus id ante ac wisi hendrerit bibendum. Etiam a mi. Vestibulum malesuada nisl. Vestibulum eget nulla non quam aliquet mattis. Aliquam molestie lacus sit amet metus. Maecenas sit amet turpis posuere purus cursus cursus. Morbi at sem. Quisque malesuada hendrerit mauris. Cras tincidunt dignissim orci. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Quisque magna urna, auctor consectetuer, tristique sit amet, porta sit amet, dui.
Stats
Paragraphs Words Bytes 2 168 1149
A Numbered List
Below we have an ordered i.e. numbered list. Unordered lists can also be made by following similar procedure as that of making ordered lists after clicking the unordered list button on the format toolbar. 1. 2. 3. 4. 5. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed nec velit sit amet dui malesuada porttitor. Fusce auctor turpis ac dui ornare feugiat. Ut et elit ut ante mattis ullamcorper. Maecenas sed tortor at tellus pulvinar commodo.
111
Nvu
To Publish A Webpage
Publishing a web page means to upload the web page file to the web server. A web server is a computer which serves web pages to the users i.e. sends the web page file to your machine when you type-in the web address of the web page in the location bar of your browser and click on the "Go" button or hit "Enter". Hence in order to make your web pages viewable by other people browsing the web, you have to upload your web pages to the web server. To publish your web pages to a web server you must have a login account on the machine running the web server. Normally, your internet service provider (ISP) gives you some web space when you sign-up with them. If you don't know the login details, you can find them either with the documentation that came with the internet connection or ask the ISP's help desk. Other options include paying a web hosting company to host your web pages or just find a free web hosting service on the internet. Free web hosting services generally keep a space on your web page for their own advertisements and/or only offer some basic functions for web hosting. You may want to look into paid services if you need more functionality.
Site Manager
Before publishing the web page to the web server, we need to tell Nvu where to publish the files. The Site Manager is the part of Nvu that manages your publishing information for one or more publishing sites. You need to create atleast one publishing site in the site manager to be able to publish your web pages. To create an account in the site manager to publish your web pages you need to have the following information:
Url of your website, e.g. http://www.mydomain.com/username Url of the FTP server, e.g. ftp://mydomain.com Username for your FTP account Password for your FTP account
To create an account for publishing your web site in Nvu's site manager, click on Edit > Publish Site Settings, which will open the Publish Settings dialog box shown in Fig 5.1. Fill in the information in the respective fields as shown in Fig 5.1. Site Name is just a convenient name used to distinguish the publishing site from other sites created in the Site
112
Nvu Manager. Users should be careful while typing in the password, it is case sensitive and thus MyWebPass will be different from mywebpass.
Publishing
Once you are done writing and formatting your page, you need to publish the page to the webserver. If you have followed the tutorial, you should have your publishing web site settings set in the site manager at this stage. If you haven't done that yet, please go back to the section Site Manager and create an account for your publishing web site. To publish the page you have created in this tutorial, click on the Publish button in the composition toolbar. Clicking Publish button opens the Publish Page dialog box, Fig 5.2. Publish page dialog will use the default publishing web site account if you have configured more than one account. Choose the web site you want to publish to from the drop down menu. You can also change the title of the page if you want to, but that is generally not the case as we already have a logical title. The file name of the page being edited is also displayed automatically. The Site Subdirectory for this Page: is an important field to fill in. For example, if you are publishing to a virtual server (when you have you website as http://username.domain.com/), your web host will usually create a directory of the same name i.e. username.domain.com in your home directory. Thus when you publish your files, you might have to put username.domain.com in the subdirectory field as the base publishing directory. In case you get an error when you try to publish your document, the site subdirectory is the most common cause of the error. Please ask the helpdesk people of your webhost for details or post in Nvu Forums for help. Image:PublishPage.pngFig 5.2 Publish Page dialog box If you have other files in your page, for example, images, video clips, etc., you should also publish them to your web site. To accomplish this select the check box for "Include images and other files". Its also advisable to use a site subdirectory to publish images and other files to keep your web site directory listing clean and manageable. However, you are hereby
113
Nvu informed that Nvu allows to upload the linked images or files to only one subdirectory. This is not an ideal way to manage your web content. But as of now this is what Nvu offers us. If you have files (images, documents, pdf files, etc.) linked from different directories and want to keep the directory structure on your server, it is advisable to use a full featured FTP client like Filezilla. To publish the page click the Publish button. It will open the Publishing dialog Fig 5.3, and will indicate the progress of the publishing process. Do not click Cancel, as it will terminate the publishing process before it is finished. After the page is published, the publishing dialog will close and you can continue using Nvu again. Image:Publishing.pngFig 5.3 Publishing process dialog
Sample Text
Below is the sample text. Unformatted text is greyed out till it has been formatted during the course of the tutorial.
UNIQ1e7813c86161160a-HTMLCommentStrip8ff0f93735dce900000001
Sample Text
''Lorem'' ipsum dolor sit amet, consectetuer adipiscing elit. ''Nunc'' ac massa non enim dictum vulputate. ''Vestibulum'' iaculis. ''Maecenas'' nisl magna, suscipit quis, vulputate nec, egestas vel, enim. ''Ut'' venenatis blandit elit. ''Aliquam'' erat volutpat. ''Nam'' eros. ''Morbi'' imperdiet, diam at lacinia luctus, diam lacus porttitor quam, a posuere nulla sem vel diam. ''Suspendisse'' quam felis, scelerisque vel, fringilla sit amet, commodo quis, orci. ''Etiam'' at eros. ''Aenean'' facilisis adipiscing libero. ''Phasellus'' malesuada sem ornare nulla. ''Sed'' sit amet elit. '''Aenean vel turpis'''. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla rhoncus posuere turpis. Phasellus id ante ac wisi hendrerit bibendum. Etiam a mi. Vestibulum malesuada nisl. Vestibulum eget nulla non quam aliquet mattis. Aliquam molestie lacus sit amet metus. Maecenas sit amet turpis posuere purus cursus cursus. Morbi at sem. Quisque malesuada hendrerit mauris. Cras tincidunt dignissim orci. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Quisque magna urna, auctor consectetuer, tristique sit amet, porta sit amet, dui.
Stats
Paragraphs Words Bytes 2 168 1149
114
Nvu
A Numbered List
Below we have an ordered i.e. numbered list. Unordered lists can also be made by following similar procedure as that of making ordered lists after clicking the unordered list button on the format toolbar. 1. 2. 3. 4. 5. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed nec velit sit amet dui malesuada porttitor. Fusce auctor turpis ac dui ornare feugiat. Ut et elit ut ante mattis ullamcorper. Maecenas sed tortor at tellus pulvinar commodo.
115
Nvu
Further Reading
In order to be able to exploit Nvu to its full potential, you should read more about HTML, CSS, HTML standards, etc. Below are a few links (links -- you should know how we created these!) for your reference. Read the text on the linked web sites and use Nvu while reading to get the most out of it. A constantly growing list of similar links can be found at delicious community bookmarks. HTML HTML Help by the Web Design Group Getting Started with HTML NCSA (at UIUC) Beginner's Guide to HTML (pdf, zip) HTML - More Advanced Features W3Schools HTML Tutorial Ian Graham's Intro to HTML CSS Adding a Touch of Style The 15 minute Guide to CaScadeS W3Schools - CSS Tutorial WDG - CSS Quick Tutorial Westciv - Complete CSS Guide References W3C - HTML 4.01 Specification W3C - XHTML 1.0 W3C - CSS 2.1 Specification WDG - CSS Resources
Postscript
This tutorial, like my earlier article 15 Minute CaScadeS Guide, has come up due to lack of availability of introductory material for Nvu. New users, most of them who don't know that Nvu is based on Mozilla Composer, had nowhere to turn to for a tutorial like article. An article written for Nvu was basically the requirement. I hope this article will be useful enough for beginners.
116
Nvu It would be unethical for me to not thank the persons without whose help this article would not have been completed and been available in xpi form. Thanks to R.J.Keller and Daniel Glazman. Thanks is also due to the Nvu development team which has made Nvu, the true WYSIWYG editor, available for general users for all major operating systems. The tutorial undergoes revisions and updates with introduction of new features in Nvu and user feedback. To have the latest version of the Nvu Tutorial extension, do not forget to check for new releases by clicking the "Update" button in the extension manager. As an alternative, you can visit the official Nvu Tutorial page.
117