HTML » General coding tips
When you're new to HTML it's probably hard to know where to begin. It might seem boring to start with first things first, but it'll make it easier for you in the long run.
Where to code
You don't have to use Horseland for coding, because if you do something wrong that "messes up" your site, you'd have to reset it and you'd loose your code. I use a program called FirstPage 2006, it's free and it's very easy to use if you use it only as a monitor (I never use the easy design part of it though). A link to where you can download it is found in the link section, under downloads. You can also use MS Notepad. When you have written some code, save it somewhere you can locate it later, and save it as thename.htm – where the clue is "htm". It has to be saved as a htm-document to be viewed in your browser later. When you have saved the document, open the folder it's located and double click on the file, and it will open in your standard browser for example Internet Explorer. To make changes, go back to the notepad, do your changes, save, then refresh your browser. The updates will then show.
How to code
Start with something simple. If you want to make a layout, start with learning how to make tables, at least if you want to make a Horseland layout. There are better forms of coding if you want to make a personal home page, like css boxes. But on Horseland, tables are everything. And I want to give you a really good advice. Start by adding one small thing, check if it works, add some more, check again. Then if something fails, you know where in the code to look for it. So many players add all their code, with text inserted, and when it fails, they have no idea where to look for the error – the code is huge, and it can be a tiny error in the code that makes it go wrong.
Some tips
As I said, start by learning tables. It can be a good idea to draw some tables on a piece of paper first. Then add code to it. It can be hard to keep cells, columns, tags and so on from each other. Use google if you're stuck, there are loads of good sites that explains what you need. Use other tutorials if you can't understand mine. Google can also be used if you have forgotten a piece of code. Let's say you only remember "<img = "address.jpg">, use google to search for the rest by adding img html code, and you'll get a lot of hits. It is also a good tips to download Mozilla Firefox if you only use Internet Explorer, so you can check how your code looks in that browser too. To many players use "bad coding" that fits only sloppy Internet Explorer. Firefox follows the standards for how to display html, hence it's a lot stricter and might show your code very poorly. And last, make sure your layout doesn’t only fit a 1024px wide screen. You should use the "gap covering" banner I'm talking about in the cover up layout tutorial if you are making a cover up layout – make sure it's of the same color as the background of your layout. And it's not a good idea to use absolute positioning on the layout picture (how you position it), while using a centred background image. The background image will be wrongly positioned compared to the layout picture and text – just try to resize your browser window to a smaller and wider window, you'll see how the background image moves itself in and out of place.
Not to do
It should be needless to say, don't copy other players' code and use it after you've changed it a bit. Most players recognize their own code and they will report you for stealing. Most layout codes that are sold are stolen, and you're the one that will suffer from lost layout if someone reports you. Html can be copyrighted. It's true that the writer didn't invent html, but just as someone copyright an English novel, even though he/she didn't invent English, a designer can copyright html. It's in the way the code is put together the power lays, not as language it self.
Mozilla firefox
As previously said, firefox follows browser standards, while Internet explorer doesn't. Therefore, firefox are a lot stricter with your code – it does not accept sloppy coding. You should always check how your layout looks in firefox when you're done. It might not look so good… If you code well in all browsers, you're a good html coder.
Here are some guidelines:
- Make sure you use tr and td tags in ALL tables or the table will be ignored
- Don't use span scroll boxes only div, as span scrolls doesn’t scroll in firefox
- Make sure all column widths adds up to the table width when you make expanding textareas, or it will be wrongly fitted in firefox
- Define width and height inside AND ouside the inline css in table tags
- Dont use div layers with absolute positioning. They will not fit the background image on all screens nor window sizes. Use tables instead
- Don’t use centering on some things and positioning on some. For example absolute position 0, 0 on the layout image then center on the background picture
- Close ALL tags, exept br and img tags (<center> + </center>)