Posts tagged as:

HTML

My first page - a basic HTML recipe

by Miraz on August 7, 2008

Could you follow a recipe to cook scones? If so, read on.

A lot of tools these days try to protect people from HTML — that’s the coding that turns text into a web page. But even if you’re using an easy publishing system, or a blog, having a bit of a grasp of some of the basics of HTML gives you more knowledge, more power and a greater ability to produce great results. And the basics are not hard. If you can follow a recipe to make scones then you can use some basic HTML.

The Basic Starter Kit

Here’s the world’s most basic web page. Copy the following text and paste it into a document using a text editor such as Notepad on Windows or TextEdit on Macs — both programs are supplied free with the Operating System. Check the settings on both programs to check they save files as plain text, not as RTF or any other format. Mac users see Use Plain Text options for TextEdit when writing HTML files.

Save the file on your desktop with the filename: page01.html. Do not under any circumstances use a word processor such as MS Office, because it inserts invisible weird characters that later show up in odd places.

<html>
<head>
<title>My first web page</title>
</head>
<body>
<p>My first paragraph. </p>
</body>
</html> 

And yes, most of it is lower case.

Now, a real web designer will fall over laughing at this and probably expostulate that you need all kinds of other coding for even a minimum web page. That’s what I’d do, if I were reading this instead of writing a 600 word article. But this is the bare minimum you need, to start understanding HTML. The stuff that’s important for us is what comes between <body> and </body> — the body of a web page. Just ignore the rest (but don’t leave it out).

Open the Web Page

kit-first-page-01.jpg. Now that you’ve saved the file page01.html on your Desktop open up a web browser: Internet Explorer, Firefox, Safari, or whichever one you use. Go to the File menu and choose a command like Open File. Choose page01.html and open it into your web browser. [The screenshot shows the page after adding a second paragraph and emphasising some text, as described below.]

Your first web page will be displayed. It’s a bit plain, and bland, and raw, but it’s a start, and you made it. It should say: “My first paragraph.“. If it doesn’t, double check what you’ve typed against what’s written here. All those angle brackets and things should be identical.

Change the Web Page

Go back to your text editor where page01.html should still be open (or open it again). The HTML tags (codes) <p> and </p> show where a paragraph starts (<p>) and stops ( </p>). The slash in the second tag shows that you’ve ‘closed’ the paragraph. Click after </p> and type another pair of paragraph tags: <p> </p>
.

Now click between the two tags you’ve just added and type another paragraph. Here’s how that section of my page looks now:

<p>My first paragraph. </p>
<p>My second paragraph uses fake words
to make it stretch over a few lines: Lorem ipsum
dolor sit amet, consectetuer adipiscing elit.
Curabitur gravida. Donec rutrum. Nunc interdum
lorem eget nibh ullamcorper vestibulum. Integer
nisi. Pellentesque id orci vitae sem dapibus placerat. </p>

Check your coding

Save your document and go to your web browser. Either click the Refresh / Reload button or follow the earlier steps to open the saved file. Your web page should now have two paragraphs.

Emphasise a few words

Just one more thing for this starter recipe. You may feel it’s pretty important that this is your first web page, so let’s emphasise that word. Bold may leap to your mind as formatting that shows something is important, but other techniques sometimes feature on websites too, such as red, or upper case, or larger text, or italics. How you show a word or phrase as emphasised is between you and your web designer. What you need to do in the HTML is show that the text should stand out somehow on the grounds that it’s emphasised.

You need to code it as being ‘strong‘ (emphasis). Most web browsers will automatically use bold for that, but a web designer can make the web browser use another technique.

Here’s what you do — you use the <strong> tag, like this:

<p>My <strong>first</strong> paragraph. </p> 

Save your web page again and again refresh your web browser. You should now see that the word ‘first‘ stands out.

Now you’re coding!

In the next Tip I’ll show you how to add some headings and a link. (Headings tip for the adventurous: experiment with these: <h1> </h1>, <h2> </h2>, <h3> </h3>).

Written by Miraz Jordan for, and reproduced from CommunityNet Aotearoa Panui, August 2008. This article may have been modified for publication here.

Popularity: 9% [?]

{ 0 comments }

Use Plain Text options for TextEdit when writing HTML files

by Miraz on August 7, 2008

If you were going to write some HTML using the Mac’s free text editor TextEdit you need to make sure the Preferences are set for plain text, not for RTF. [See My first page - a basic HTML recipe.]

I suggest the following choices for the Preferences. The screenshots below are from Mac OS X 10.5.4 (Leopard). If you use a different version of the Operating System some things may be different.

kit-textedit-prefs-01.jpg.

The important choices under New Document are the Plain Text format and not to check the Smart Quotes option. Wrap to page is a good choice to stop long lines of text from dribbling off to the right so you have to scroll sideways. Window Size and Font are purely a matter of taste — set them how you like.

kit-textedit-prefs-02.jpg.

For the Open and Save preferences check the box for Ignore rich text commands in HTML files. If you follow the brief ‘recipe’ in my next post choose one of the XHTML types for HTML Saving Options, rather than one of the HTML (no X) types.

Popularity: 9% [?]

{ 0 comments }

Newbies Guide to iWeb 06

by Miraz on February 13, 2008

With iWeb 06 anyone can publish a blog or podcast right from their Mac. In this Newbies Guide Miraz Jordan shows you how to share your photos, movies, thoughts and ideas with friends, family and the world at large. [First published April 2006. Some details may be a bit dated.]

Apple’s iLife 06 software package brought significant updates to iPhoto, iMovie, iTunes, iDVD, Garageband and also introduced the new iWeb 06. While you don’t have to have a .Mac account to use iWeb this article shows you how to use one to create your own blog.

.Mac account

Sign up for a trial or paid .Mac account.

Screenshot 1: Sign up for a trial or paid .Mac account.

If you want to experiment with .Mac sign up for a 60 day trial account. Open up iWeb and click the Learn More button on the splash screen. Once you’ve filled in the online form you can click the Sign In button on iWeb’s splash screen. It will open up the .Mac System Preference where you can enter your login name and password. Your computer will store these for you, making it easy to use iWeb for publishing.

Create a web page

Open iWeb and choose a template for your web page. I’m going to choose a Blog in this article. iWeb now opens up a document with some placeholder information. My choices have brought me a photo of someone on a snowboard, a header that says: Blue bird day, today’s date and some junk text.

This is just to get me started. The idea is that I’ll replace the photo, heading and junk text with real content of my own.

A blog is a website in the format of a diary or journal. You make regular, probably fairly short, entries, maybe including pictures, videos or sound clips. Each new entry appears at the top of the Home Page. Older entries automatically move into an archive. A blog is fantastic for keeping friends and relatives up to date on happenings.

My first blog entry

Replace the photo.

Screenshot 2: Replace the photo.

OK, first to go is the chap on the snowboard! I click on the photo and a Tooltip shows up to tell me to drag a new photo in to replace this one. But how and where?

At the bottom of the window is a button marked Media. I click that and then click on the tab for Photos. Now I can see all the photos in iPhoto where I choose a picture of my cat. I could also just drag in a photo from anywhere on my computer, and that may in fact be a better idea if I have prepared some photos with reduced file sizes. See the Sidebar for more on this.

Tip: use iPhoto to resize and optimise your photos before you add them to your blog.

Choose Export... from the File menu in iPhoto.

Screenshot 7: Choose Export… from the File menu in iPhoto, set the File Format to jpg and scale the photo down to a more realistic 600 * 400 pixels or smaller. Save it in a separate folder and drag it in to iWeb from the Finder.

Note: as a comparison, most of the screenshots in this tutorial are 340 pixels wide.

Drag the picture from the media window on top of the photo to be replaced.

Screenshot 3: I drag the picture from the media window on top of the photo I want to replace.

Tip: make the Media window larger so you can better see your photos. Drag the diagonal stripes at bottom right of the window.

Next I double click on the heading text and type a new heading to replace it. Finally I double click the junk text and type my own entry to replace it. Voila — an entry about what’s going on at our place today.

The Blog header

That takes care of the first entry, but what about the grander design? What about the overall header? Text and pictures will let people know who I am and where this blog is. I need to click on the item Blog in the Site Organizer on the left. This shows my new Cats at play entry in context.

Follow the principal of double clicking text and entering what you want to say. Click on the photo and click the media button to select a new photo for your Blog.

With text selected use the Colors and Fonts buttons at the bottom of the window to change colours, font sizes and styles.

Also click on the Archive item and change the default photo to one of your own.

Publish your blog

Make sure you have rights to the material you're publishing.

Screenshot 4: Make sure you have rights to the material you’re publishing.

Well, with all the hard work done, let’s get this Blog on the road! Connect to the Internet and click the Publish button at bottom left of the iWeb window. iWeb pops up a wee reminder message about copyright then gets on with the job.

You may have to wait a while at this stage. Even with a high-speed connection it took quite a while to upload my cat photo and bit of text. Luckily there’s a progress bar to keep me informed. If I had optimised my photos this should go quicker.

Announce, Visit or just click OK.

Screenshot 5: Announce, Visit or just click OK.

Once finished though I was presented with some very pleasing options: Announce my new blog, Visit the site or just OK, I know it’s done. This being a brand new blog and all I decided to Announce it. Note that the dialog box also told me the address for my new blog. This helpful dialog box appears every time you Publish your site.

On clicking the Announce button I’m taken to my default email program where a newly created message contains some default text with a link to my site.

Visit the page

The finished blog..

Screenshot 6: The finished blog.

Back at the iWeb screen I can now click the Visit button at bottom left of the window. This opens my default web browser and takes me to my Blog. I added more entries before I made the screenshot.

Caution

This is a pretty easy way to make a blog. It’s quick, easy and convenient. It allows you to drag photos straight out of your iPhoto library and into iWeb. iPhoto 06 also has a button to send photos to your blog.

The pages themselves are attractive and you can easily change fonts, colours and layout. Your blog has its own RSS feed — the increasingly popular method for tracking updates to web pages.

But once you have more than one or two photos on your blog you may find your .Mac size limit has been reached and visitors may find your pages are slow to load, because the images haven’t been optimised for web pages. I found that my two entries plus header and archive graphics filled almost 8Mb of the 25Mb available to me for my free trial.

My cat and cabbage tree photos arrived on the web page as 500Kb files. Any web design professional or enthusiast would have reduced that to 50Kb (which would load 10 times as fast).

It would be a good idea to export photos from iPhoto at a reduced size and use those more moderately sized pictures in your blog. It adds a step but could save you a lot of money and prevent your visitors from being so frustrated they never visit your blog again.

Photocasting, podcasting and more

iWeb 06 makes it equally easy to publish a blog, photos, audio or video podcasts or just regular web pages. Try it out, have a bit of fun and see what you can do. A trial .Mac account will give you 60 days to experiment before you decide if this is something you want to do more seriously.

First published in Macguide magazine Issue #26 March / April 2006 and republished with permission. This article may have been modified from the original.

Popularity: 37% [?]

{ 0 comments }