Banners (and use of old HTML tags)
Posted: Mon Mar 11, 2013 2:26 pm
XHMTL 1.0 became a W3C recommendation in 2000, XHTML 1.1 in 2001.
Parts of the monarchy game code (and a lot of current banners) uses tags that were already depreciated in HTML 4.01 (e.g. <center>, <font>, <strike>).
In order to allow the screens to function while I slowly clean up, we are currently using the XHTML 'Transitional' document type, which tell browsers to render the page according to those specifications.
That means that - for now - some of the older depreciated tags (e.g. <font> and <center>) still work. However, there are other elements that no longer function.
The align attribute is a good example of this. <p align="center">, <td align="center"> etc do not work at all.
As the doctype is XHTML it is important that tags are opened and closed in the same order, it is important that the same case is used for an opening and closing tag, it is important that all tags ARE closed.
e.g.
<p>...........</p> <-- close it
<B>.......</B> <-- same case
<p><b>........</b></p> <-- close in the correct order
Tags like <br>, <img> and <hr> that do not have a second closing tag should be closed by adding a space and forward-slash to the end of the opening tag e.g. <br />, <img /> and <hr />
You should also get in the habit of surrounding an attribute with either single-quotes or double-quotes e.g. <p style='...'> or <p style="....">
Gradually we will be moving towards a website that is optimised for modern browsers, smartphone etc. That means HTML5 is the eventual fate. It also means that - for now - your banner habits need to improve. Otherwise a layout might work for you, but not for guildmates using a different browser, phone etc.
That also means a whole host of additional tags and attributes that will stop working.
Basically, in the long run we're going to need to take away the ability to custom code banners using HTML, and switch to widgets that have been formatted and tested to make sure they work for all browsers.
That's a way off though.
--------------------------------------
In the mean time you need to get an understanding of CSS2 in order to satisfy your needs to have pretty looking banners.
http://www.w3schools.com/cssref/default.asp
Relying on these older inline attributes to change the look of text is fine, until you try and change something that I've already set via CSS. At that point you'll probably notice that nothing seems to happen.
That's because the CSS I've set, is overriding the old HTML attributes.
If you want to override something I've set as the standard syle for a tag (such as <p> being centered), you need to do one of two things.
1. Start your banner with <style> tags, and add a selection of css classes or ids to style things how you want.
You can then use the class="" or id="" attributes to change the style of a tag.
If you go for this method make sure that you pick class names that do not interfere with the standard layout
2. Use the style="" attribute on any tag that you wish to change the style.
--------------------------------------
This thread can be used to discuss (or ask questions about) how to use CSS, and also to start thinking about what sort of banner plug-ins you like to see in the future.
Parts of the monarchy game code (and a lot of current banners) uses tags that were already depreciated in HTML 4.01 (e.g. <center>, <font>, <strike>).
In order to allow the screens to function while I slowly clean up, we are currently using the XHTML 'Transitional' document type, which tell browsers to render the page according to those specifications.
That means that - for now - some of the older depreciated tags (e.g. <font> and <center>) still work. However, there are other elements that no longer function.
The align attribute is a good example of this. <p align="center">, <td align="center"> etc do not work at all.
As the doctype is XHTML it is important that tags are opened and closed in the same order, it is important that the same case is used for an opening and closing tag, it is important that all tags ARE closed.
e.g.
<p>...........</p> <-- close it
<B>.......</B> <-- same case
<p><b>........</b></p> <-- close in the correct order
Tags like <br>, <img> and <hr> that do not have a second closing tag should be closed by adding a space and forward-slash to the end of the opening tag e.g. <br />, <img /> and <hr />
You should also get in the habit of surrounding an attribute with either single-quotes or double-quotes e.g. <p style='...'> or <p style="....">
Gradually we will be moving towards a website that is optimised for modern browsers, smartphone etc. That means HTML5 is the eventual fate. It also means that - for now - your banner habits need to improve. Otherwise a layout might work for you, but not for guildmates using a different browser, phone etc.
That also means a whole host of additional tags and attributes that will stop working.
Basically, in the long run we're going to need to take away the ability to custom code banners using HTML, and switch to widgets that have been formatted and tested to make sure they work for all browsers.
That's a way off though.
--------------------------------------
In the mean time you need to get an understanding of CSS2 in order to satisfy your needs to have pretty looking banners.
http://www.w3schools.com/cssref/default.asp
Relying on these older inline attributes to change the look of text is fine, until you try and change something that I've already set via CSS. At that point you'll probably notice that nothing seems to happen.
That's because the CSS I've set, is overriding the old HTML attributes.
If you want to override something I've set as the standard syle for a tag (such as <p> being centered), you need to do one of two things.
1. Start your banner with <style> tags, and add a selection of css classes or ids to style things how you want.
You can then use the class="" or id="" attributes to change the style of a tag.
If you go for this method make sure that you pick class names that do not interfere with the standard layout
2. Use the style="" attribute on any tag that you wish to change the style.
--------------------------------------
This thread can be used to discuss (or ask questions about) how to use CSS, and also to start thinking about what sort of banner plug-ins you like to see in the future.