Basics of HTML coding.

Page 1 of 1

8 Replies - 707 Views - Last Post: 01 October 2012 - 03:20 AM

#1 Crazydude757  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 30-September 12

Basics of HTML coding.

Posted 30 September 2012 - 05:06 PM



Hello there! This is my first tutorial, and I hope you enjoy it!


Lets start with the sections shall we? :gunsmilie: Here is a basic example of what the starting layout of the HTML should look like (The spaces between the sections represent were to put information).
<html>
<head>

</head>
<body>

</body>
</html>


See? Looks simple right? Well it is quite simple! Allow me to explain just a moment...

The <html> tags are used at the start of the HTML page.
The <head> tags are used for non-visible code that still effects the page.
The <body> tags are used for visible content that you will see on the page.

And of course your probably wondering... What is that / for on the 2nd tag? Well a / symbol indicates that it is a closing tag, which is used for stopping the current section or tag!

<sarcasm>If you have stayed with me till here you Good job you have somewhat of an attention span!:clap:</sarcasm>

Now lets move on to some useful tags to use on your page!

If you want to write text you have several options
such as:
//For writing paragraphs.
<p> </p>

//For writing small amounts of text.
<text> </text>

//For writing italic texts.
<i> </i>

//For writing bold texts.
<b> </b>

//For writing underlined texts.
<u> </u>

//For writing striked through texts.
<s> </s>



I could go ON and ON and ON about different types but I think that should get you far enough for now...

Now if you want to add javascript coding you add this into your HTML coding.
<script type="text/javascript">



Now you have two options where to put it!

#1. Non-visible coding
Put it in the <head> </head> tags.

#2. Visible content
Put it in the <body> </body> tags.

Small add on to javascript(when scripting in java use "//" to make that line a comment. it does nothing visibly to the coding yet when your coding gets longer it helps mark thing to identify what the code means!)

There, Now you better understand how to add javascript to your page! AAAAAWWWWW YEEEEAAAAH!!:bananaman:


Well now we'll do one more thing before I leave you to mess around with your new found skills!

Let's do a simple "Hello world!" HTML page.
with java and without java versions.

Here is the coding for it in java, I will explain with comments.
<html>
<head>
</head>
<body>
<script type="text/javascript">

System.out.Print("Hello world")

</script>
</body>
</html>



Here is the coding for it without java, will explain below codes.
<html>
<head>
</head>
<body>
<text>Hello world!
</text>
</body>
</html>



If you where paying attention earlier you should already understand this but let's recap.

Okay all we're doing in the code is in the visible content (body section) we are writing the text "Hello world!". I know I know your probably thinking "This is wa-a-a-ayyy to easy of a project! When are we going to get to the fun part?". Well With all do respect these are the basics! It gets more fun the farther you go but remember! *YOU GOTTA KNOW THE BASICS*. :tank:

Thanks for reading and have fun with coding!

Is This A Good Question/Topic? 0
  • +

Replies To: Basics of HTML coding.

#2 Crazydude757  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 30-September 12

Re: Basics of HTML coding.

Posted 30 September 2012 - 05:33 PM

My apologies to you good people I just caught an error in my text! When adding javascript to the html you dont add
 <script type="text/javascript">

every time! you only add that when the script involves text based scripting otherwise you put in the correct type. Example:
<script type="application/javascript">

Was This Post Helpful? 0
  • +
  • -

#3 ThrowsException  Icon User is offline

  • D.I.C Head

Reputation: 33
  • View blog
  • Posts: 83
  • Joined: 21-February 12

Re: Basics of HTML coding.

Posted 30 September 2012 - 06:04 PM

Why are you putting Java code in Javascript tags. Java != Javascript.
Was This Post Helpful? 0
  • +
  • -

#4 fromTheSprawl  Icon User is offline

  • Monomania
  • member icon

Reputation: 513
  • View blog
  • Posts: 2,056
  • Joined: 28-December 10

Re: Basics of HTML coding.

Posted 30 September 2012 - 06:23 PM

This is not possible:

System.out.Print("Hello world")



Unless you're coding in JSP's, and even then you shouldn't do them in Javascript but in the JSP's delimiters (<%%>). Might be you want to try using alert instead?

Quote

Let's do a simple "Hello world!" HTML page.
with java and without java versions.


Dude, if you want to code "Hello World" with Java and HTML use a JSP or an Applet. ^^
Was This Post Helpful? 0
  • +
  • -

#5 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,236
  • Joined: 08-June 10

Re: Basics of HTML coding.

Posted 01 October 2012 - 01:30 AM

first, if this is supposed to be a tutorial, why not posting it in the tutorials’ section?

second, there is no element <text>.

third, you should also check, whether there are DIC tutorials that already cover this topic.
Was This Post Helpful? 1
  • +
  • -

#6 fromTheSprawl  Icon User is offline

  • Monomania
  • member icon

Reputation: 513
  • View blog
  • Posts: 2,056
  • Joined: 28-December 10

Re: Basics of HTML coding.

Posted 01 October 2012 - 01:58 AM

He's new, that explains it. Is it usually frowned upon if a tutorial already exists for a topic?
Was This Post Helpful? 0
  • +
  • -

#7 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,236
  • Joined: 08-June 10

Re: Basics of HTML coding.

Posted 01 October 2012 - 02:15 AM

View PostfromTheSprawl, on 01 October 2012 - 10:58 AM, said:

Is it usually frowned upon if a tutorial already exists for a topic?

I would make an exception if either there is significantly new content or a sufficiently better explanation.
Was This Post Helpful? 0
  • +
  • -

#8 fromTheSprawl  Icon User is offline

  • Monomania
  • member icon

Reputation: 513
  • View blog
  • Posts: 2,056
  • Joined: 28-December 10

Re: Basics of HTML coding.

Posted 01 October 2012 - 02:20 AM

I see, I'll keep that in mind, thank you. ^^
Was This Post Helpful? 0
  • +
  • -

#9 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6063
  • View blog
  • Posts: 23,517
  • Joined: 23-August 08

Re: Basics of HTML coding.

Posted 01 October 2012 - 03:20 AM

Yeah, and if you want to do a tutorial, you probably should have a better grasp of the subject on which you're writing. And post it in the correct area.

Closed.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1