You are viewing our Forum Archives. To view or take place in current topics click here.
How to HTML and CSS Code for Beginners
Posted:

How to HTML and CSS Code for BeginnersPosted:

Huntxr
  • TTG Senior
Status: Offline
Joined: Dec 12, 201014Year Member
Posts: 1,121
Reputation Power: 52
Status: Offline
Joined: Dec 12, 201014Year Member
Posts: 1,121
Reputation Power: 52
How to HTML Code for Beginners




Software

Crimson Editor [ Register or Signin to view external links. ]

[ Register or Signin to view external links. ]

Eclipse [ Register or Signin to view external links. ]

[ Register or Signin to view external links. ]

Notepad ++

[ Register or Signin to view external links. ]

[ Register or Signin to view external links. ]






Declaring a Doctype

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">


[ Register or Signin to view external links. ]

All you have to do is copy and paste this on the top of your HTML Document. All this is doing is just telling that the code that you are writing is HTML.




Adding a Title

Start off off with

<html>

</html>


Just place it after the doctype (a line down)
Now everything that you write will go in between that.

In between that just put this
<title>

</title>


What does title do?
It changes this to whatever text you put in between the title

[ Register or Signin to view external links. ]

What does the code look like so far?
[ Register or Signin to view external links. ]




How to Save and Open the Document

Saving

Name it whatever just make sure that you put .html after it
.html


Opening






How to add a Image to your HTML Document

First open up your document and decide where you would like to place it. Next, you need to add your image.


Way 1
You need to have it uploaded to a picture hosting website here's a few.
[ Register or Signin to view external links. ]
[ Register or Signin to view external links. ]
[ Register or Signin to view external links. ]

You are going to want the direct link so go ahead and copy it.

[ Register or Signin to view external links. ]

Now put this into your HTML Document at your desired place.

<img src="DIRECT LINK PLACE" alt="ALT" />


What it looks like in whatever you are writing you code in...

[ Register or Signin to view external links. ]

Way 2

Instead of uploading it a picture hosting site you can simply copy and paste the location on your computer

<img src="location of image on your pc here">
Ex. <img src="Home.png">





Adding some Text

Adding a Paragraph

First you need to add this code into your HTML Document

<p> </p>


Put your text in between that and it should look like this

[ Register or Signin to view external links. ]

Adding a Headers


Put your header in between these (I only have two but you can have as many as you want.

<h1> </h1>
<h2> </h2>


Way it looks on the HTML Document

[ Register or Signin to view external links. ]

What do they look like on the Site?
[ Register or Signin to view external links. ]




Making a Drop Down Menu
Cheating is okay with some things. You can generate yours own Drop Down Menu code by going to the site [ Register or Signin to view external links. ]

Fill out the Form
[ Register or Signin to view external links. ]

Now copy and paste that at your desired place in you HTML Document




CSS Basics

First go ahead and open up your text editing software and save the file as whatever you want just make sure it says .css after it


Okay so before anything you are going to want to make sure that you HTML Document knows the css that you are using so to do that...

<link rel="stylesheet" href="Name of CSS FILE HERE.css"
      type="text/css">


href means name of file so there you put whatever you named you .css file


Now you are ready to start changing the colors of your text and background

Changing Background Color

To change the background color of your body just put this inside of your CSS File.

body {background-color:black;}


Change Black to whatever color you want.

Changing the Text Color

Say you would like the change the color of your paragraph.
All you need to do is put
p {color:white;}

You can change the color to whatever you desire also, you can change the p before the brackets to whatever text color you wish to change.

Like for h1
h1 {color:white;}


Or for h2
h2 {color:white;}





Site for testing HTML Codes

[ Register or Signin to view external links. ]





Updates
Just added Drop Down menu tutorial - 11/26/11




[ Register or Signin to view external links. ]


Last edited by Huntxr ; edited 8 times in total

The following 3 users thanked Huntxr for this useful post:

Lucario- (11-26-2011), Bank (11-24-2011), TTG_Viziionzz (11-20-2011)
#2. Posted:
SyntaxError_81
  • Ladder Climber
Status: Offline
Joined: Oct 20, 201113Year Member
Posts: 322
Reputation Power: 13
Status: Offline
Joined: Oct 20, 201113Year Member
Posts: 322
Reputation Power: 13
Huntxr wrote



Declaring a Doctype

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">


[ Register or Signin to view external links. ]

All you have to do is copy and paste this on the top of your HTML Document. All this is doing is just telling that the code that you are writing is HTML. Don't bother memorizing this because it is pointless to!





Its not pointless to memorise or learn what DOCTYPES that you need to use. :facepalm:
#3. Posted:
Huntxr
  • TTG Senior
Status: Offline
Joined: Dec 12, 201014Year Member
Posts: 1,121
Reputation Power: 52
Status: Offline
Joined: Dec 12, 201014Year Member
Posts: 1,121
Reputation Power: 52
SyntaxError_81 wrote
Huntxr wrote



Declaring a Doctype

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">


[ Register or Signin to view external links. ]

All you have to do is copy and paste this on the top of your HTML Document. All this is doing is just telling that the code that you are writing is HTML. Don't bother memorizing this because it is pointless to!





Its not pointless to memorise or learn what DOCTYPES that you need to use. :facepalm:

Well I see no need to...

If you do thats great
#4. Posted:
Nic
  • Retired Staff
Status: Offline
Joined: Jun 08, 201014Year Member
Posts: 2,466
Reputation Power: 1070
Motto: I've been watching you all day.
Motto: I've been watching you all day.
Status: Offline
Joined: Jun 08, 201014Year Member
Posts: 2,466
Reputation Power: 1070
Motto: I've been watching you all day.
Or just switch to HTML 5 and use <!DOCTYPE html>

How could you ever forget that.
#5. Posted:
iPatobo
  • 1000 Thanks
Status: Offline
Joined: Sep 05, 201014Year Member
Posts: 3,218
Reputation Power: 209
Status: Offline
Joined: Sep 05, 201014Year Member
Posts: 3,218
Reputation Power: 209
Just my 2c, but in my opinion, Notepad++ is a great program for writing any code.

I find it the best, maybe add in a download for users.
#6. Posted:
Z61
  • V5 Launch
Status: Offline
Joined: Apr 16, 201014Year Member
Posts: 4,309
Reputation Power: 179
Status: Offline
Joined: Apr 16, 201014Year Member
Posts: 4,309
Reputation Power: 179
iPatobo wrote Just my 2c, but in my opinion, Notepad++ is a great program for writing any code.

I find it the best, maybe add in a download for users.

I also prefer Notepad++ it never fails for me.
#7. Posted:
Huntxr
  • TTG Senior
Status: Offline
Joined: Dec 12, 201014Year Member
Posts: 1,121
Reputation Power: 52
Status: Offline
Joined: Dec 12, 201014Year Member
Posts: 1,121
Reputation Power: 52
iPatobo wrote Just my 2c, but in my opinion, Notepad++ is a great program for writing any code.

I find it the best, maybe add in a download for users.

I added Notepad ++ to the software list.

-Huntxr 8)
#8. Posted:
TTG_Viziionzz
  • TTG Master
Status: Offline
Joined: Jul 21, 201014Year Member
Posts: 879
Reputation Power: 34
Status: Offline
Joined: Jul 21, 201014Year Member
Posts: 879
Reputation Power: 34
Nice Post! Keep it up!
#9. Posted:
Zion
  • TTG Addict
Status: Offline
Joined: Jul 03, 201014Year Member
Posts: 2,120
Reputation Power: 95
Status: Offline
Joined: Jul 03, 201014Year Member
Posts: 2,120
Reputation Power: 95
Zachman61 wrote
iPatobo wrote Just my 2c, but in my opinion, Notepad++ is a great program for writing any code.

I find it the best, maybe add in a download for users.

I also prefer Notepad++ it never fails for me.


I too use NP++, and enjoy every bit of it.

Also, if you are new to web development or design don't even think about using Dreamweaver. Trust me, please. If not, you'll become like this.
#10. Posted:
Huntxr
  • TTG Senior
Status: Offline
Joined: Dec 12, 201014Year Member
Posts: 1,121
Reputation Power: 52
Status: Offline
Joined: Dec 12, 201014Year Member
Posts: 1,121
Reputation Power: 52
Added Image Tutorial and some Text Tutorials

-Huntxr
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.