CKEditor allows you to add images to your documents in an easy and intuitive way.
To insert an image simply press the button on the toolbar. The Image Properties dialog window that will open lets you set configuration options that define image source, its size, display properties, or other advanced properties.
The Image Properties dialog window includes four tabs that group image options:
All tabs contain the and buttons that let you accept the changes or close the dialog window without performing any changes, respectively.
Once inserted into the document, the image can be edited at any time by double-clicking it. The Image Properties dialog window will open again and you will be able to introduce changes to the image configuration options.
If you attempt to close the Image Properties dialog window without saving the changes, you will be prompted to do so:
You can either proceed without saving your changes by choosing OK or close the alert window with the Cancel command and save the changes.
Image Info
The Image Info tab is the default tab that opens after you press the button on the toolbar. It allows you to set the image URL and configure the way it will appear in the document.
Below is an overview of all Image Info tab elements:
- URL — the web address of the image. The image may be located on the same server as the web site you are now in or on an external server.
- External server: If you want to use an external address, use the full absolute path.
- Example:
- http://example.com/image1.jpg
- Local server: If the image is located on the same server, you can use an absolute path that omits the domain name and starts with a slash.
- Example:
- /images/image2.jpg
- If CKEditor is integrated with a file browser (like CKFinder), you can also use the Browse Server button to select an image from the ones that are available on the server.
- External server: If you want to use an external address, use the full absolute path.
- Alternative Text — a short textual description of the image that tells users with assistive devices (like screen readers) what the image is about. You should always provide your images with meaningful alternative text in order to make it accessible to users with disabilities.
- Width — the width of the image in pixels. By default this is the size of the original image.
- Height — the height of the image in pixels. By default this is the size of the original image.
- Border — the size of the solid border around the image in pixels.
- HSpace — the horizontal spacing (or margin) between the image border (if present) or the image itself and other document elements that surround the image, in pixels.
- VSpace — the vertical spacing (or margin) between the image border (if present) or the image itself and other document elements that surround the image, in pixels.
- Align — the alignment of the image in the document. Available options are Right and Left.
- Preview — a preliminary view of the selected image formatted according to the options chosen on the left.
Image manipulation
With CKEditor you do not have to worry about resizing your image.
If the image is too big, you can alter its dimensions by entering new values into the Width and Height fields. By default the image ratio is locked, which you can see thanks to a button. This means that when you change one of the size values (width or height), the other one will be adjusted automatically.
If you want to freely modify both dimensions, click the button in order to unlock the ratio. The button will now change to and modification of one dimension will not automatically cause the other one to be adjusted. To lock the image ratio again, click the button once more.
You can easily return to original image size by pressing the button. This will reset the image size; the original width and height will now appear in appropriate text boxes.
Link
The Link tab lets you assign a link to an image inserted into the document. The link can point at any kind of object available in the Internet — a simple URL address, a PDF document, or an online video.
This might prove especially useful if, for example, you want to add a thumbnail that would lead the reader of your document to a full-size copy of the image or add a company logo and point to its website.
To use the Link functionality, first you need to insert an image into a document using the Image Info tab. After you configured the display options, switch to the Link tab and set the image target using the available options.
Below is the overview of all Link tab elements:
- URL — the web address that the image should be pointing at. This may be a plain website address, an image, or other file that is located on the same server as the web site you are now in or on an external server.
- External server: If you want to use an external address, use the full absolute path.
- Local server: If the target location is on the same server, you can use an absolute path that omits the domain name and starts with a slash.
- Example:
- /howto/images
- /images/largeimage2.jpg
- If CKEditor is integrated with a file browser (like CKFinder), you can also use the Browse Server button to select an image or a file from the ones that are available on the server.
- Target — the window where the assigned link will open after clicking the image. You can choose between New Window (
_blank
), Topmost Window (_top
), Same Window (_self
), or Parent Window (_parent
).
Important notice: If you want to edit an image that is connected with a link, use the context menu open with the right mouse button and choose the Image Properties option. The Image Properties window will let you modify both the image and the link that it is pointing to. If you double click such image instead, you will open the Link dialog window that will only allow you to edit the link properties and not the image itself.
Upload
Notice that this bookmark may not be available if CKEditor is not connected to the file manager, such as CKFinder.
The third bookmark is the "Upload" section:
- Upload: specifies the location of the image file on your local hard drive. User may also use "Browse" instead of typing the location manually.
Pressing "Send it to the Server" sends the image to the server.
Advanced
This bookmark is only for advanced users:
- Id: specifies image's ID.
- Language Direction: sets the language direction from left to right ( LTR ) or from right to left ( RTL ).
- Language Code: specifies the language code e.g. en, pt, pl.
- Long Description URL: specifies the description of the page.
- Stylesheet Classes: specifies the name of the CSS class.
- Advisory Title: specifies the description of the target object.
- Style: specifies the style.