Log in

View Full Version : HTML for dummys



iUnknown
20-07-2008, 01:01 PM
Hello,

I'm just going to explain some of the very basics of HTML.

Right, we know <b>this text</b> would be in bold, anyone who uses cutenews or has the smallest experience with websites or even myspace will know that.

So everything needs tags around it beginning with a word or letter. So the tags for an image is <img></img>. As there is usually no text inbetween these tags, a little shortcut you can take is making it <img />. Now, that will do nothing, it's just the tags. So we have to add what I call variables to the tag. So you want to make it show the image http://yourdomain.com/mypic.png. You use src as the variable for that so all you do is add that variable to the <img> part of the tag, so after the <img

So for every variable you add it is set out like this: variable="value"

So, the variable is src and the value is http://yourdomain.com/mypic.png. So the code will be <img src="http://yourdomain.com/mypic.png"></img> or <img src="http://yourdomain.com/mypic.png" />

Easy peasy, all you gotta know is the variable.

You can add more variables to it like height and width easily, so if you want to stretch the image to exactly 200 x 200 then you simply add these variables with those values. I prefer <img src="http://yourdomain.com/mypic.png" /> to <img src="http://yourdomain.com/mypic.png"></img> so:

<img src="http://yourdomain.com/mypic.png" height="200" width="200" />

How easy was that?!

Ok, a small thing that I want to say as well, you might know that <br> is a line break so if you put <br> in it'll go to the next line, however, that is not the proper way/XHTML way to do it. You should always have a beginning tag and end tag so you could put <br></br> or, the shortcut way, <br />. No one will ever call you a 1337 coder if you do <br> rather than <br />!!1!1!

Ok so the other thing that you'll want to know is how to do a link. Well the tag is <a>. The variable for an URL that it goes to is href. So you do <a href="http://yourdomain.com/page2.html"></a>

However, with that code, there won't be any text that you can click which is the actual link. From the <a> or <a whatever you have here > that is where the link begins and </a> ends it. So you'd put text between them, so:

<a href="http://yourdomain.com/page2.html">Click here for page 2</a>

Now, the target variable can be used to decide where the link appears. If you have an iframe, then you could make the value of the target the iframe's name and it would appear in the iframe. So if the iframe is called main:

<a href="http://yourdomain.com/page2.html" target="main">Click here for page 2 in the iframe</a>

It goes to iframe called main. For new window the value is _blank. So:

<a href="http://yourdomain.com/page2.html" target="_blank">Click here for page 2 in new window</a>

Simple. If you just want it to open on the same page then you don't need to define a target.

Oh and what I said earlier, <b>this text</b> is bold, you can use <i> for italic and <u> to underline. There are more like <s> for strike-through but I'm not going to explain them all. Remember to ALWAYS close the tag with /> at the end or </a> or </b> etc.

So that's the very basics, I'm sure it will help people who don't really have a clue about HTML.

Independent
20-07-2008, 01:05 PM
No offense, but almost every user that doesn't post in this forum as well know's HTML.

Meanies
20-07-2008, 01:07 PM
People can't really get very far with just that much. Nice idea though, but they could just use w3schools.

iUnknown
20-07-2008, 01:17 PM
I created this so that I can point people who I know need this to this thread. The ones that don't use w3schools because they're too lazy. This just gets the basics of how HTML works in their mind.

So many people who come to me for a certain code just think that HTML codes are things that are set codes for certain purposes and not customizable. They don't understand how the codes are made - and if your a newbie, this really helps.

Independent
20-07-2008, 01:22 PM
When I was learning ajax I found it easier with a live example of the code in action, even if it was just a screenshot.. etc.

iUnknown
20-07-2008, 01:32 PM
Ok but this is the basics of HTML and this is just what loads of people I know need ;)

Klydo
20-07-2008, 01:34 PM
God sake, give the guy a break. He wrote a handy tutorial for anyone who doesn't code HTML, what's wrong with that?

Nice little tut :)

iUnknown
20-07-2008, 01:36 PM
God sake, give the guy a break. He wrote a handy tutorial for anyone who doesn't code HTML, what's wrong with that?

Nice little tut :)

Thanks :rolleyes:

Joshuae
20-07-2008, 01:42 PM
Not really needed as W3 schools teaches it easier, and more efficently.
But good one anyway.

Excellent1
20-07-2008, 01:44 PM
Yeah.. get off his back. He's done a tutorial out of his kindness for absolute nooby HTML coders such as Joshuae and co.

Joshuae
20-07-2008, 01:46 PM
Yeah.. get off his back. He's done a tutorial out of his kindness for absolute nooby php coders such as Joshuae and co.


This is for HTML. :eusa_whis
And, wow - I don't want to learn PHP? Officially it doesn't make me a noob as I have never looked into coding it. ;) Since noob = new to something.

And if you read, I posted a good decent comment. Not something rude and abusive. So if you'd kindly shut the hell up.

Excellent1
20-07-2008, 01:50 PM
This is for HTML. :eusa_whis
And, wow - I don't want to learn PHP? Officially it doesn't make me a noob as I have never looked into coding it. ;) Since noob = new to something.

And if you read, I posted a good decent comment. Not something rude and abusive. So if you'd kindly shut the hell up.
I edited the post sherlock*+*+ I just don't get how you can say it's not really needed when all you know about HTML is what the name stands for?

On-topic: Maybe add a tad more? Like using images for links etc?

Joshuae
20-07-2008, 01:53 PM
I edited the post sherlock*+*+ I just don't get how you can say it's not really needed when all you know about HTML is what the name stands for?

On-topic: Maybe add a tad more? Like using images for links etc?


Look at the post time, then the edit time.
One minute before.

& No, I know HTML actually. :) and CSS, just not that great with slicing & positioning. Sorry.

Now, lets not get this thread closed.

& Yeah, I'd like to see this go further adding more stuff for say dynamic content which is used?

Meanies
20-07-2008, 01:53 PM
I edited the post sherlock*+*+ I just don't get how you can say it's not really needed when all you know about HTML is what the name stands for?

On-topic: Maybe add a tad more? Like using images for links etc?
It isn't really needed, there's many more in-depth guides on HTML elsewhere which detail things like your suggestion. Both myself and Joshuae said it was a good idea but isn't really needed unless there are more detailed things, most people will know what <b> does and <img> etc are pretty much self-explanatory.

Klydo
20-07-2008, 01:57 PM
It isn't really needed, there's many more in-depth guides on HTML elsewhere which detail things like your suggestion. Both myself and Joshuae said it was a good idea but isn't really needed unless there are more detailed things, most people will know what <b> does and <img> etc are pretty much self-explanatory.
So what if it isn't needed? People may stumble across this thread being a general HxF user who doesn't even know what w3schools is.

Excellent1
20-07-2008, 02:04 PM
So what if it isn't needed? People may stumble across this thread being a general HxF user who doesn't even know what w3schools is.QFT ^^

Joshuae
20-07-2008, 02:26 PM
So what if it isn't needed? People may stumble across this thread being a general HxF user who doesn't even know what w3schools is.


Didn't think about that too much. Whoops.

Independent
20-07-2008, 03:26 PM
Guide addon;
<img>

This tag is for displaying images on your HTML page, the image tag has a few attributes.

src, border, javascripts bits and bobs.

How do I display an Image?
<img src="http://www.imagehost.com/image.extension">
How do I make it so, they click an image and it goes somewhere else?
<a href=""></a> <-- First, we must wrap an "a" around it, with a href attribute, in the href tag you enter the URL you would like the user to be pointed too.

<a href="http://www.habboxforum.com"><img src="http://www.imagehost.com/image.extension"></a>

Basically..
image.extension -> yourimage.gif or any other image format.

Hope this helps, sorry if I crashed the thread xD

Protege
20-07-2008, 05:44 PM
Guide addon;
<img>

This tag is for displaying images on your HTML page, the image tag has a few attributes.

src, border, javascripts bits and bobs.

How do I display an Image?
<img src="http://www.imagehost.com/image.extension">
How do I make it so, they click an image and it goes somewhere else?
<a href=""></a> <-- First, we must wrap an "a" around it, with a href attribute, in the href tag you enter the URL you would like the user to be pointed too.

<a href="http://www.habboxforum.com"><img src="http://www.imagehost.com/image.extension"></a>

Basically..
image.extension -> yourimage.gif or any other image format.

Hope this helps, sorry if I crashed the thread xD

First learn what each attribute/element/tag means before you try to even attempt to teach someone else it...

Independent
20-07-2008, 05:58 PM
First learn what each attribute/element/tag means before you try to even attempt to teach someone else it...
I know what the tags/elements/attributes are, I just don't know the full "name" for "a". My tutorial is correct, so don't bother slating it as you haven't contributed.

Protege
20-07-2008, 06:07 PM
LOL, I'm telling you to revise what you post before you go ahead trying to teach people stuff - its like your PHP for example...

The code you posted for showing an image isn't even HTML 4 valid.

This is valid...

<img src="http://www.tehupload.com/images/app-595052135371962611tehup.png.png" alt="website">

Klydo
20-07-2008, 06:40 PM
Actually it's;


<img src="imageurl.gif" alt="displayed text" />

You need to declare the tag as closed.

Protege
20-07-2008, 06:57 PM
In XHTML, I'd agree with you but in traditional HTML 4.01, no.

iUnknown
20-07-2008, 07:52 PM
Sorry it's not XHTML/HTML 4 valid, but it does the job? :P

Want to hide these adverts? Register an account for free!