|
|
Post a Project »
Find a Professional HTML Freelancer!
Find a Freelancer to help you with your HTML projects
| |
|
HTML tag questions please
11-21-2008, 08:26 AM
|
HTML tag questions please
|
Posts: 132
|
Hello all, I am new here, I am now starting to learn web designing and I am leraning from the w3schools tutorials, I was told that I can questions here? If so, my first 2 questions are:
1] Regarding <body> tags, I am noticing that using this tag does not make difference so why use it?
2] HTML Comments? This what the tutorial says:
Quote:
|
Comments can be inserted in the HTML code to make it more readable and understandable. Comments are ignored by the browser and not displayed.
|
I don't understand and see no difference if this is used or not?
Help please?
|
|
|
|
11-21-2008, 08:35 AM
|
Re: HTML tag questions please
|
Posts: 32
|
BODY: The body tag is there to indicate the main section of your page. In other word anything that is visible to the user (content wise) goes between <body> and </body>. If you want your pages to be valid you have to use it. Why validate? Well, that's another discussion.
HTML Comments: Say you have a page with approx 1000 lines of code. Content boxes, menus, sub menus, some other content. When you write the code you just know what you are doing. Try though opening the same page after 3 or 6 months. Will you be able to tell what is going on? Which part of your code does what? So, comments are here to help you as a coder.
Even if you have to pass this page to another coder, there's no way for him to know what is going on. Well, the most experienced could tell in a minute, but why not give them an easy time by providing some comments for each section of your code? 
__________________
Please login or register to view this content. Registration is FREE Professional PSD to XHTML coding services
|
|
|
|
11-21-2008, 09:22 AM
|
Re: HTML tag questions please
|
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
Besides the fact that the <body> tag is required in order for the page to validate, it is a very useful element that serves as a parent to all other elements. The body can have its own style rules applied to it (and nearly always does), which range from font-size, to line-height, to a background, etc. Since font-size, if done proportionally, is inherited by children elements, styling the body like this is a good way to give uniformity to the document.
Also, the body is sometimes used for onload events for JavaScript. Functions can be placed on it that affect the document in a special way, since it is the parent to all of the content.
So, although it is technically possible to not include the body in a document, when it comes to doing anything significant, it is silly to leave it out. Therefore, it is best practice to never do so.
__________________
I build web things. I work for the startup Please login or register to view this content. Registration is FREE
.
|
|
|
|
11-21-2008, 09:25 AM
|
Re: HTML tag questions please
|
Posts: 32
|
Good points wayfarer07 
__________________
Please login or register to view this content. Registration is FREE Professional PSD to XHTML coding services
|
|
|
|
11-21-2008, 10:35 AM
|
Re: HTML tag questions please
|
Posts: 479
Name: Alan
Location: Lincoln(UK)
|
Two great posts by tsiger and wayfarer07.
|
|
|
|
11-24-2008, 05:54 PM
|
Re: HTML tag questions please
|
Posts: 132
|
Sorry I did not get the email notif for these posts guys but THANKS for the explanations, I will be posting more and more questions as I go along, appreciate it.
|
|
|
|
11-26-2008, 07:04 AM
|
Re: HTML tag questions please
|
Posts: 132
|
This, I am not getting:
Quote:
Non-breaking Space
The most common character entity in HTML is the non-breaking space.
Normally HTML will truncate spaces in your text. If you write 10 spaces in your text HTML will remove 9 of them. To add lots of spaces to your text, use the character entity.
|
What does it mean "if you write 10 spaces of text?"
|
|
|
|
11-26-2008, 07:14 AM
|
Re: HTML tag questions please
|
Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
|
press the space bar 10 times
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
11-26-2008, 07:21 AM
|
Re: HTML tag questions please
|
Posts: 132
|
Still don't understand, if I press the space bar 10 times between any 2 words, I don't see anything changing? Can I have a real example of this please?
|
|
|
|
11-26-2008, 07:24 AM
|
Re: HTML tag questions please
|
Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
|
That's because:-
Quote:
|
If you write 10 spaces in your text HTML will remove 9 of them
|
Though strictly it doesn't remove them, simply ignores them.
look in the source code you'll find 10 (or more) spaces
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
11-26-2008, 07:47 AM
|
Re: HTML tag questions please
|
Posts: 132
|
Ok thanks, got that now this last part:
Quote:
|
To add lots of spaces to your text, use the character entity.
|
first why would you want to "add lots of spaces to your text"? Can you give me an example please?
Last edited by mikehende; 11-26-2008 at 07:56 AM..
|
|
|
|
11-26-2008, 07:57 AM
|
Re: HTML tag questions please
|
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
Usually you want to avoid using a bunch of to add space, as it is typically better to use margins or padding instead. However, if you're being lazy, you could space out all sorts of things, from items in a navigation, to pretend "tabs" at the beginning of sentences, etc.
One other common use of a is to stop a table cell from breaking a line automatically (by using it instead of a regular space, so that the block of text is treated by the browser as a single word).
__________________
I build web things. I work for the startup Please login or register to view this content. Registration is FREE
.
Last edited by wayfarer07; 11-26-2008 at 07:59 AM..
|
|
|
|
11-26-2008, 08:14 AM
|
Re: HTML tag questions please
|
Posts: 132
|
Let me see if I get this, so the text space we are talking about is simply empty space in a line of text? Sort of like when you start a paragraph you would usually start writing maybe an inch or so away from the left margin of the page? If this is correct, what would I have to type to do this please?
|
|
|
|
11-26-2008, 08:20 AM
|
Re: HTML tag questions please
|
Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
|
Formatting basically
eg:
with response
.write "<input type="
.write chr(34)
.write "hidden"
.write chr(34)
.write " name="
.write chr(34)
.write "error"
.write chr(34)
.write " value="
.write chr(34)
.write strErrorURL
.write chr(34)
.write g_sTagEnd
.write vbcrlf
.write "<input type="
.write chr(34)
.write "hidden"
.write chr(34)
.write " name="
.write chr(34)
.write "refer"
.write chr(34)
.write " value="
.write chr(34)
.write strReferURL
.write chr(34)
.write g_sTagEnd
.write vbcrlf
end with
Should look like this:-
HTML Code:
with response
.write "<input type="
.write chr(34)
.write "hidden"
.write chr(34)
.write " name="
.write chr(34)
.write "error"
.write chr(34)
.write " value="
.write chr(34)
.write strErrorURL
.write chr(34)
.write g_sTagEnd
.write vbcrlf
.write "<input type="
.write chr(34)
.write "hidden"
.write chr(34)
.write " name="
.write chr(34)
.write "refer"
.write chr(34)
.write " value="
.write chr(34)
.write strReferURL
.write chr(34)
.write g_sTagEnd
.write vbcrlf
end with
Or you may want a wide gap for effect;
As I said to the other day
Code:
As I said to the other day
or;
you might want it to look like you are speaking slowly
Code:
you might want it to look like you are speaking slowly
You can of course use various html elements to handle this but for a one off situation it may be complete overkill. So for a double/triple spaced sentence, you use one space plus one or two nbsp entities.
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
11-26-2008, 08:31 AM
|
Re: HTML tag questions please
|
Posts: 132
|
GOT IT!! Thanks!!
|
|
|
|
11-27-2008, 12:28 PM
|
Re: HTML tag questions please
|
Posts: 12
|
If you want to these type of coding you can use <pre> tage for this purpose and when you want to end this then close </pre> tage. The results will be the same as it shown in note pad. For example
I am
learning
HTHL.
HTML Stands
for
Hypyer
Text
Markup
Language.
The results will be show as it you see.
|
|
|
|
12-23-2008, 09:30 AM
|
Re: HTML tag questions please
|
Posts: 132
|
The underneath is taken from the tutorial, what I don't understand is , how do you edit any of those 3 pages please? It says to use Notepad as the editor but I don't understand how to link what I write in notepad to any of the 3 pages?
Quote:
Creating Your Own Test Web
If you just want to learn HTML, skip the rest of this chapter.
If you want to create a test web on your own computer, just copy the 3 files below to your desktop.
(Right click on each link, and select "save target as" or "save link as")
mainpage.htm
page1.htm
page2.htm
After you have copied the files, you can double-click on the file called "mainpage.htm" and see your first web site in action.
|
Last edited by mikehende; 12-23-2008 at 09:32 AM..
|
|
|
|
12-23-2008, 10:56 AM
|
Re: HTML tag questions please
|
Posts: 489
Name: Adam
|
First you have to save the file:
And then you have to open it in notepad (Not Word it uses the wrong formatting/quotes).
Enjoy!
Last edited by Decaf; 12-24-2008 at 01:13 PM..
|
|
|
|
12-23-2008, 11:08 AM
|
Re: HTML tag questions please
|
Posts: 9,007
Name: Tim Daily
Location: Apex, NC, US, Sol 3
|
When you open the page in Notepad, it shows the source code. That's what you make changes to. For instance, copy and paste the two links on the mainpage in the source code and save the file. Now open the file from your desktop (which will open it from your default browser) and note that there are now four links displayed, the original two and the two you copied.
Saving a template works much the same way. You save the page as "Web page, complete" which also saves the images and other files the page uses to display. You can edit all of these with Notepad (well, except the images, of course).
tim 
|
|
|
|
12-23-2008, 04:16 PM
|
Re: HTML tag questions please
|
Posts: 1,606
|
Allow me to try this one. If you open the mainpage file used above in notepad, you will see this:
Quote:
<html>
<body>
<h1>This is my Main Page</h1>
<p>This is some text.</p>
<p><a href="page1.htm">This is a link to Page 1</a></p>
<p><a href="page2.htm">This is a link to Page 2</a></p>
<p> </p>
<h1> </h1>
</body>
</html>
|
You can then edit any of the content between the <h1> </h1> or the <p> </p> tags, save the page and have something entirely different shown on the page.
Html is nothing more than text and images enclosed between tags to format it for a browser.
I also suggest you download notepad2 or other free text editor than use line numbers. That feature will help other help you when you hit a snag. It also will help you find your mistakes because of the syntax highlighting feature.
|
|
|
|
|
« Reply to HTML tag questions please
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|