For Absolute Beginners, the tutorial

Have been using the “HTML For absolute beginners” tutorial and notice that using the <br> in the test mode for “world’s most basic webpage” allows the doctype to be displayed. I will assume I should leave them out. ???

I’m pretty sure there are some layout mistakes in the 19 page article. An example would be that the “comments” examples are not shown in the image below the discussion. Could be me.

Hi easilyconfused, welcome to the forums

I don’t think the DOCTYPE should be showing no matter what tags are used in the mark-up.

And there may be a few errors.

To make sure we’re talking about the same thing, got a link?

Off Topic:

eva bevo convert2media scam

This is page 5 of the tutorial. If you copy and paste the example into text editor and convert to html you get the doctype Learn HTML and CSS: An Absolute Beginner’s Guide Article » SitePoint

Actually I think there’s something funky going on with FireFox. For a millisecond or two the example displays as a jpg (guessing) and then converts to html. I may be copying something I wasn’t intended to see. There’s quite a few weird things going on so that it makes the tutorial mostly unusable for me.

Ah yes, that code example is indeed messed up.

I’m guessing a “convert newlines to break tags” function was used when it shouldn’t have. The function is good to use when you’re taking text from an input and then displaying it in web page when you want to preserve the line breaks, but it really messed up things here.

The code should look something more like

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="">
		<title>The Most Basic Web Page in the World</title>
		<meta http-equiv="Content-Type"
			content="text/html; charset=utf-8"/>
		<h1>The Most Basic Web Page in the World</h1>
		<p>This is a very simple web page to get you started. 
		Hopefully you will get to see how the markup that drives 
		the page relates to the end result that you can see on 
		<p>This is another paragraph, by the way. Just to show how it

Break tags would be OK at the end of a sentence, like

		<p>This is a very simple web page to get you started.<br>
		Hopefully you will get to see how the markup that drives 
		the page relates to the end result that you can see on 

But I would say its a safe bet you should remove those that appear at the end of lines in the examples.

Well it drove me crazy for nineteen pages but the end result is that I learned a lot. Another thing I saw over and over again was <strong><strong> with nothing between them.

I wonder if the paper book is like this. Would kind of like to order it.

The paper and ebook versions should NOT have those errors.

They may contain mistakes, but books have an “errata” page that you can check to see known problems.

And you can download files from their “code archive” if you don’t want to type everything into your text editor. Though for me typing helped me to learn a lot when I first started (before I got “copy/paste” lazy). Now I only type new code I’m writing.

The book doesn’t have those errors (I have a review copy). It’s the Blogs that weren’t correctly altered during the latest re-design. The Blogs are adding erroneous carriage returns.

If you just ‘copy and paste’ the relevant code samples into a plain text editor you won’t get any erroneous BR appearing. You aren’t supposed to copy the actual [blog] page source code. :wink:

Just highlight the code sample text and copy that as you view the page normally (those grey sample blocks) not the source.

With the exception of the few DOCTYPE lines; you should always try to code everything by hand. Especially the content between the BODY it’s the best way to learn from your own mistakes.

I suspect because it’s an extract from the book it probably wasn’t reworded enough to take into account people reading the blog and using that as the code source. Instead of the code archive or actual book itself. :slight_smile:

You aren’t supposed to copy the actual [blog] page source code.

I have something you don’t have: the perspective of a stone-beginner AND old-man status (made in 1945). I feel I must tell you that folks like me are going to copy and paste knowing that they want to get the feel for the text editor converting to html. Why impede your initial attempts with typos? The blog did suggest the archives as a possibility for those who didn’t want to type. And besides, I wouldn’t have known not to type it verbatim and would have had the same result.:slight_smile:

Engima teachers must have had a similar problem if they tried to send lessons via Enigma.:smiley:

Don’t worry, it’s an easy mistake to make; we nearly all do things like that when learning from source code. I’ve probably done similar myself in the long distant past so don’t feel that you are alone. Glad you took it the right-way - it wasn’t a sarcastic wink but one of recognition. Believe me it gets easier if you keep practising the code. Hopefully it will be like riding a bike in time. :smiley:

But now you know why, you were getting those BR because it was mainly a book extract. Not really rewritten to take into account for the Blog by the looks of things.

Well, anyway I suppose it’s something new you have learnt that Content Management Systems don’t always generate clean code. For example those empty STRONG, etc. :slight_smile:

No offense taken. Enjoying the hell out of it.:wink:

:lol: I remember back when I started I copied/pasted the line numbers from an example (hey, in Basic they were part of the code) - after I saw them rendered and a brief shocked “Huh?” boy did I feel foolish.

Thanks, Where can I find more examples?