In KompoZer, in any of the WYSIWYG modes (Normal, HTML tags and Preview), it is impossible, using the mouse alone, to place the cursor at certain positions within the underlying code. The two most commonly encountered cases are:
- Placing the cursor between a pair of opening tags or closing tags
(e.g. To remove the <br> tag that KompoZer places when you delete a block nested inside another)
- Placing the cursor between two blocks
(e.g. To insert an image between two blocks, especially amongst a set of floated blocks)
When you attempt these manoeuvres using the mouse alone, the cursor always gets placed within the nearest block. Nor is it possible with the keyboard alone, as the cursor then skips from one block to the next. However, accurate placement of the cursor is possible using mouse and keyboard in combination. Start with these three steps:
- Place the cursor in the general area of the target point, using either mouse or keyboard
(To place the cursor inside the target block)
- On the Status Line, click on the target tag.
(To select the entire block including opening and closing tags)
- Hit the left or right cursor key
(To move the cursor outside the block i.e. beyond the block's opening or closing tag)
Once the cursor is in one of these "external" positions, the cursor grows to in size to occupy the full height of the target block's containing block. You are now ready to delete code found there or enter/paste in new code.
In essence, the techniques is a variation of the process that one might use to place the cursor accurately immediately before or after an image tag. Click on the image to select it, then hit the left or right cursor key. In this case the extra steps are needed to select an entire block including its containing tags, rather than just the content, before using the cursor key.
You used the option at the bottom of the INSERT menu to place Break Below Image(s) code at the end of a paragraph. Now you realise it won't pass validation as you are using the default HTML 4 STRICT doctype for your page. You decide to remove it. The trouble is that using your keyboard only techniques the best you can do is delete more than you want joining the content below to the current paragraph, so then you have problems rebuilding the styling of the later content.
Instead, to remove the code segment (<br clear="all">) use the cursor placement technique described above. It doesn't matter if the break code is placed inside or outside the paragraph's closing tag. Select the block in which, or after which, the "break below image(s)" has been inserted, then hit Cursor-Right followed by Backspace.
NOTE: KompoZer appears to treat both the "<br></p>" and "</p><br>" pairs as a single closing tag! Once outside the paragraph and and then backspacing, the tag pair is deleted. However, KompoZer immediately re-closes the paragraph re-inserting a </p>, thereby removing the <br> code regardless of its original position in the code.
While the Markup Cleaner (On the TOOLS menu) can assist with this task, it will remove all examples on the page potentially causing more problems than it solves.
You have a master page with a menu bar. The menu button code includes a linkless menu button intended to refer to the current page. (See: Creating a Master Page to re-create this page) You've made a copy of the master page and need to move the code for the linkless button.
NOTE: This is a poor example, as normally one would simple add or remove the link code and edit the button legend to achieve this result. However, it does demonstrate how the cursor placing technique can be used.
1. To select a menu button and its legend - Click somewhere in the text of the button to be moved, then on the button's tag on the status line (In this case the <li> tag).
2. To cut the selected block and place it on the clipboard - from the EDIT menu select CUT (Or use the keystroke CTRL-X).
3a. Start to position the cursor at the target location - click somewhere in the text of a button to one site of the target position, then on the button's tag on the status line. (In this example the the button to the right of the target position is selected.)
3b. Complete positioning of the cursor at the target location - hit the Cursor-Left or Cursor-Right key. (In this example we choose Cursor-Left to move the cursor out of the final button's <li> block so the cursor flashes between buttons two and three.)
4. Place the previously cut code at the cursor position - from the EDIT menu select PASTE (Or use the keystroke CTRL-V).
NOTE: Selecting a complete block of code by clicking on the status line tag is both quicker and more reliable than dragging over text as it is guaranteed to pick up both opening and closing tag of the block as well as all of its contents.