« Maps in Google en Bing | Main | Solliciteren doe je zo »
zaterdag, 11 juli, 2009
Using the iWeb HTML Snippet
There are two ways to add custom HTML code in the HTML Snippet in iWeb.
The first way is for code that you normally would place in the
body of a HTML webpage. The webpage does not require external JavaScript
or CSS files or JavaScript or CSS code in the HEAD section
of the webpage.
External Widgets like Google Maps, the IFRAME
& DIV HTML elements and the OBJECT HTML
element for displaying movies are such examples.
| You insert | iWeb adds | Result is | ||
|---|---|---|---|---|
| <html><head> | <html><head> | |||
| <title></title> | <title></title> | |||
| </head> | </head> | |||
| <body> | <body> | |||
| <code>your code</code> | → | → | <code>your code</code> | |
| </body> | </body> | |||
| </html> | </html> |
The second way you can apply when your HTML code in the body
requires a JavaScript file of your own device or external CSS files or
custom CSS code in the HEAD section you want to use for
display purposes.
You can create a complete working HTML page in
an external HTML Editor of your choice and simply paste the complete
code in the HTML Snippet.
Examples are the Lytebox
Slideshows, which require JavaScripts en CSS files in the parent
of the page when using the IFRAME HTML element. See samples here.
| You insert | iWeb adds | Result is | ||
|---|---|---|---|---|
| <html><head> | <html><head> | |||
| <title></title> | <title></title> | |||
| </head> | </head> | |||
| <body> | <body> | |||
| <code>your code</code> | → | nothing | → | <code>your code</code> |
| </body> | </body> | |||
| </html> | </html> |
On publishing, iWeb creates a widget1_markup.html file in a folder with the iWeb pagename. The widget1_markup.html files has a sequence number when there are more HTML Snippets in a page.
When using relative pathnames to files on your webserver, count three (3) directories down the path: src="../../../_iFrame/if_leeg.html" to escape from the iWeb site folder.
See also :
– absolute
vs. relative pathnames
– inserting
a webpage/file with the IFRAME HTML element