The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
I like to keep my coding clean, but I find so many people doing things differently that I get confused.
For instance, I know I should close open tags like and
but what about and ? Also, should I try my best to work in lowercase or does it really make no different whatsoever?
<br>
, <img>
, <meta>
etc are known as "self-closing" or "empty elements" in HTML, and don't need the end slash or closing element.HTML also has the concept of "interpreted closing", where by the use of one element is meant to automatically mean the previous element is to close:
<table>
<tr>
<td>A
<td>B
<td>C
<tr>
<td>1
<td>2
<td>3
<tr>
<td>1
<td>2
<td>3
</table>
... each new
<td>
implies the previous column is now closed, as does each new <tr>
imply the previous row is done. This was to require less HTML code in the days of slow internet connections, small browser cache and little storage space.xHTML, because it is a form of XML, does need these elements to be closed, as by design XML uses this strict structure.
<link [B]/[/B]>
<br [B]/[/B]>
<img [B]/[/B]>
<meta [B]/[/B]>
The space between the tag / last attribute in the element is for compatibility. If you're using another XML mark-up language (i.e. not xHTML), the closing slash should be added without a space, for example:
<elements>
<name value="Machie"[B]/[/B]>
</elements>
XML is case-sensitive, and the XML versions of HTML (xHTML) has been defined to be written in lower-case. However, if you were to create your own mark-up structure in XML, you could pick upper or lower-case letter as and where you like, such as
<MyEleMent>
.As for ATOM and RSS, I'd go for one or the other, rather than both. I've gone for RSS myself, and have felt no need to worry about ATOM. Offering both can be confusing to users in my view, especially with browsers that offer direct subscriptions to feeds, and if users are offered an RSS or ATOM feed, they may not know which is the one to choose, and may become confused for no reason, or may pick both!!
<img src="images.myimage.png" with="100" height="100" alt="My image" />
if you are using a doctype that requires it, such as transitional or strict XHTML. Other tags such a the tag are made up of two parts so should have a closing part, such as <strong>This is bold</strong>
.As for RSS and ATOM, one is the alternative for the other. ATOM was developed as an alternative to RSS as it was believed RSS had some flaws so you could provide feeds in both formats just to cover yourself.
Should I just go with one instead of leaving it up to my users which one they want to subscribe to?
I like to keep my coding clean, but I find so many people doing things differently that I get confused.
For instance, I know I should close open tags like and
but what about and ? Also, should I try my best to work in lowercase or does it really make no different whatsoever?