Saturday, September 22, 2007

In Which Order Should Tags Be Inserted - Part 1: Image Tag

In general tags can be inserted in any order as long as you respect the golden rule stating: "the tag opened first should be closed last".

In other terms, if two or more tags are used to format some text, there must be a tag that wrap this text, then another tag wrap both text & the previous tag & so on, finally we'll get a code composed of initial text & tags wrapping it. Then if you look at this code from left to right you'll see it starting with the starting part of some tag, & ending with the ending part of that same tag. Does this make sense? If not here's a previous detailed lesson with examples & all:

Generally if you respect that, it doesn't matter in which order tags come & wrap text, but there are some exceptions, they concern [img], [url] & [color] tags, in this lesson we'll talk about [img] tag:

[img] tag must always be the closest to the picture link!


We saw an example about that in the previous lesson:

[center][img]http://www.google.com/intl/en_ALL/images/logo.gif[/img][/center] - Right

[img][center]http://www.google.com/intl/en_ALL/images/logo.gif[/center][/img] - Wrong

[img] tag has always to be in direct contact with the image it wraps or else an error happens in your final message.

We'll see later that [url] tag has a similar restriction, but even this last can't be closer to the picture link than [img] tag:

Example: (There shouldn't be a line-break in your code!)

Right:

[url=http://google.com/]
[img]http://www.google.com/intl/en_ALL/
images/logo.gif[/img][/url]

Wrong:

[img][url=http://google.com/]http://www.google.com/intl/en_ALL/
images/logo.gif[/url][/img]