HTML Basic
Introduction
Actually, iWeb is so easy that users don't need to acknowledge HTML, CSS, and javascript. However, to make your iWebsite more professional, it is necessary for users to learn about how to manipulate HTML codes. Through a hundred of tutorials on this site, we have introduced many widgets such as slideshow, gallery, menu, user interface, and so on... If you don't understand HTML including CSS (style tag) basic, you may feel difficult to make them as your own styles. (We have also received many questions about very basic programming.) There is a really great reference website to help users learn everything about Web without any fees.
Add Borders to div or images <div style="border: 1px solid #color;">
If you want to add white color, 1px border to an image: How to make borders have round-corners
<div style="-khtml-border-radius:4px; -ms-border-radius:4px; -o-border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; border-radius:4px;">
This tag will work no matter what a border exists. This style tag will work correctly on every browser except for iE6, 7. About color for texts / div / table elements
<div style="background-color: white; color: black;">
As you can see, you don't always need to type hexadecimal for color like #000000. It is allowed to type "white", "black", "red", "blue", "navy", and "gray". There are more pre-defined standard colors.
If you want to convert RGB color to hex, please visit this website, http://www.javascripter.net/faq/rgbtohex.htm Hyperlink target window options
If you want to open a link on a new window:
<a href="URL" target="_blank"> If you want to open a link on same level frame: <a href="URL" target="_self"> If you want to open a link on a top level frame: (for HTML snippet) <a href="URL" target="_top">
Set hypertext & anchor color with hover effects You must follow this order below. Otherwise it will not work. (Replace color & text-decoration as you want.)
a:link{color:#4088b8;text-decoration:none;} /* unvisited link */
How to align some elements vertically in the middle
It's impossible to align texts or images in the middle within <div>, <p> tags. Instead, you must use "<table>" elements, then insert contents into each cell. (1:1 matching within <td></td>) <table style="border-collapse:collapse;vertical-align:middle;"><tr><td>content-A</td><td>content-B</td></tr></table>
The correct way to insert relative paths
This is the most-frequently asked tip: These are summarized lists from many users' questions. We will keep updating this tutorial when we gather something important for composing HTML & CSS. |