subscribe to receive this blog per email :: unsubscribe from the mailing list

Thursday, June 10, 2010

HTML Basics 4: Images

Another tag which is very common is the <img> tag - this embeds image files into your page. Imagine how drab the internet would look if it weren't possible to display images on a web page!


Images are separate files which need to be stored online separately, and then embedded in the HTML document. You could almost think of the image tag as another kind of link tag - except that, instead of opening a new document on a new page, it displays an external file as part of the page you are looking at. It is important to remember that all image files you are using in your website need to be uploaded to your server as well - unless they are already stored on another website, and you are pointing your image tags there.


In another blog, I talked at some length about the image formats that are used on the web - the most common are .jpg and .gif. Say you have written a piece of text for your web page, but now want to embed a graphic logo on the top of the page, and a photo next to your first paragraph. Both things are achieved with the same tag. The logo will most likely be a .gif file - which is more suitable for text and line art - say it is called logo.gif, and it will be stored on your own web server, in a folder called "images". To embed it in your page, you need to write the following line of HTML: <img src="/images/logo.gif"> - that's it! The part after the img src, between the quotation marks, needs to contain not only the file name but also the *path* to your file - directions for the browser to where your image is stored. In the above example, the file would be stored in a folder called "images" which is in the main directory of your web page (more about directories some other time!).


What if you want to use an image that is stored on a different website though? Say, your brother has taken some beautiful photos on his last holiday in Switzerland and uploaded them to his personal website, and you have asked him to use one of them to decorate your essay about dairy farming in Europe. In this case, you use the same tag, but your path is the full url of the image - that is, ithe precise location on the internet where the image file is stored. So your brother's website is called www.mybigbrother.com", the image is called "cow.jpg", and it is stored in a folder called "images within the main directory of your brother's website. The tag would then read: <img src="http://www.mybigbrother.com/images/cow.jpg"> - as you can see, the tag itself hasn't changed, only the information where the image is located.


By default, images are displayed at the point in the site where the image tag is inserted, and displace text. If you would like to float it on the right or left side next to a piece of text, insert the following in your image tag: <img src="http://www.mybigbrother.com/images/cow.jpg" float="left"> - this will display your brother's photo of a beautiful Swiss dairy cow on the left side next to the paragraph of text that follows it in the HTML code.


Asni: Multimedia Art & Design:: http://webdesign.asni.net :: http://www.asni.net

Thursday, May 20, 2010

HTML Basics 3: Links

In my last blog, I have been looking more closely at the <head> tag which is one half of every valid HTML document. A couple of blogs ago, I already talked about some of the most basic HTML tags that make up the <body> of the page: <p> for Paragraph, and the different levels of headers, <h1>, <h2>, <h3>, <h4> and <h5>. Today I'll introduce the next most important tag you'll find in almost any web page: Hyperlinks.


Hyperlinks - or links, for short - are fundamental to the whole idea of the internet. The very name of the coding language we use, HTML - short for Hypertext Markup Language - includes the idea that there be links. "Hypertext" means an enhanced form of text, where virtually every word or piece of information can lead off in a different direction, by virtue of linking that word or short piece of text to another page with additional information. Remember that originally, the internet was intended for academic and research purposes - and Hypertext is the triumph of the footnote. If you've ever written an academic paper of any sort, you may know how tempting it is to drown your main argument in reams and reams of footnotes providing additional - but sometimes barely related - information. With a Hypertext document, you can have all the footnotes you want, at a mouse click, without burdening down the main argument of your text.


All you need to do is insert a link that leads off to another page. And obviously, without links, there would be no World Wide *Web*, but only a vast collection of individual and separate pages, with no way to navigate from one to the other.


The link tag has a slightly different format than most of the other tags we have encountered so far, which simply open and close - for instance <p> and </p> which are the tags that surround a paragraph of text. The link tag also consists of an opening and closing tag, but the opening tag contains some additional information - most importantly, the url of the page you are linking to!


Say, I would like to insert a link to my own home page, www.asni.net. The correct url for this page actually read: http://www.asni.net - and if you are linking to a different domain on the net, you always need to include the http:// prefix (links from one page to another on the same website are a slightly different matter, but I will cover this some other time when I talk about navigation menus and directory structures).


The format of the link tag is <a href="http://www.asni.net">Link to Asni's home page</a>. The basic tag is <a></a> - this stands for "anchor" - these tags enclose the link text which is displayed on the site. Note that the text of the link does not have to be identical to the url of the page you are linking to! I could have written this link as <a href="http://www.asni.net">www.asni.net</a>, but still, the bit that tells me where the link is pointing to is the part after the 'href=' - the url of the page I am linking to, which is always enclosed in double quotes, and needs to include the http:// prefix.


By default, the new page opens in the same browser window or tab you have just been looking at. It is often a good idea to tell the browser to open a new window or tab intead - for instance if you are linking to an external page but would really like your visitors to come back to your page after they have looked at your link. This is achieved by inserting a target="_blank" into your anchor tag. The tag then reads as follows: <a href="http://www.asni.net" target="_blank">Link to Asni's home page</a>.


Asni: Multimedia Art & Design:: http://webdesign.asni.net :: http://www.asni.net

Thursday, May 6, 2010

HTML Basics: The Head Tag

A couple of blogs ago, I introduced the most basic HTML tags to build your own web page. As I mentioned then, each HTML document consists of two main sections: the <head> </head>, and the <body> </body>. The <body> contains most of the things that are actually displayed on your screen when you view a web page. Today, however, I'd like to take a closer look at the <head>.


Most of the information inside the <head> tag is not directly visible to anyone viewing the web page. That does not mean that the contents of this section of the page are unimportant. Quite on the contrary! The head contains information that is vital for the functionality of the website - such as <style> tags that ensure the page is displayed the way it was set up by the designer, and <script> tags that specify any scripts running on your computer while you are viewing the page - for instance the popular Javascript, which enables a lot of the enhanced functionality you can admire on a professionally designed site. These can either be included in each individual page's <head>, or they can reside in an external file - a CSS style sheet or a script file - in which case the <head> tag would include a link to the external files which are needed to display the page correctly.


The <head> tag also contains information that is very important for search engines - if you are keen on improving your site ranking and get your pages found by more people, don't neglect paying attention to the tags in your <head>.


In my last blog on this topic, I already briefly covered the <title> tag. The line of text inside the <title></title> is what is displayed on top of your browser window. It is not to be confused with the main page headline inside your <body></body> tag, though it may well be the same line of text.


Next to your domain name, the <title> </title> is the single most important part of the site that determines how a search engine ranks your page's relevance for a certain keyword. Say you have a site about biking equipment. If you are lucky, you might have secured the domain "bikingequipment.com" which ensures that if someone enters the search term "biking equipment", your site is likely to be ranked quite high - if your domain name is equal to the search term entered, the search engine will assume that your site will be a good match.


These days, however, really obvious domain names are getting quite rare, and it is likely that if you are starting a new business and building a new website, someone else will have secured the domain "bikingequipment.com" already, and even alternatives like "bikingequipment.biz" or "bikingequipment.net" or "bikingequipment.co.nz" may already be taken (if the first business is smart, they will have registered all those variations themselves, to avoid having a competitor with a very similar domain name in the future).


Even if your domain has to be called something else - like "Petesstylishbikes.com" perhaps - no one can keep you from having the keyword "biking equipment" in your page title. If you are a biking equipment business located in Featherston, it would also be a good idea to include this geographical indicator in your page title - so your page might be called something like "Biking equipment Featherston Wairarapa". But beware of the temptation of making the title too long - keyword stuffing is not something that search engines appreciate. In the case of the title tag, most search engines only consider them up to a certain length - about 35 characters would be good measure.


Another tag that has some relevance for search engines is the <meta> tag. There is some dispute about just how much value search engines place on <meta> tags, and some search engines ignore them completely. Since they are not visible to the viewer, this is a place where much keyword stuffing and attempts at manipulating search engine results have occurred in the past, which has given the tag a somewhat dubious name. However, some search engines - Google included - definitely take them into consideration, so it is worth paying them some attention.


There are several kinds of <meta> tags, and they don't all have to do with content - some of them specify which language or character set is used, and if the content is mainly text, or some other media type. The meta tags relevant for your search engine optimization are the "keywords" and "description" meta tags. As the name implies, "keywords" contains a list of keywords relevant to your page, and "description" contains a short line of text that describes your page. This is often the line of text that appears in your Google search results under the link to your page.


The format of those tags is somewhat different from what we have encountered so far. Say you want to include this short page description: "Pete sells the most stylish biking gear in all of the Wairarapa". The tag would then read as follows: <meta name="description" content="Pete sells the most stylish biking gear in all of the Wairarapa" />. If you wanted to break it up into keywords, write: <meta name="keywords" content="stylish biking gear Wairarapa" />.


Asni: Multimedia Art & Design:: webdesign.asni.net :: www.asni.net

Thursday, April 22, 2010

Site Maps, or the Importance of Planning

A client recently asked me what a site map was. An excellent topic for my blog, I thought ! One can hardly overestimate the importance of planning, when it comes to web design.


One way to look at a site map is as a blue print, or the building drafts for your house. It is a graphic representation of how the website will be structured, and how the individual pages that make up the site will relate to each other: which pages visitors will see first, and where do they lead them? What are the main sections of the site? Which page links to what other pages? This will also determine how the main and secondary navigation menus are built and structured.


As a design document, the site map should also indicate any features that are needed: will there be a database, a login system, a search function? Any content that is dynamically generated? If so, what will be the sorting criteria available to the user? Will there be media files that require special treatment? Will parts of the site be built in Flash? Will there be feedback or enquiry forms, or will the users be able to leave comments and feedback? All these things should be at least considered, and hopefully decided, before work on the actual site design even starts.


The more thoroughly a site is planned out beforehand, the less risk there is of wasting time and money walking down a blind alley somewhere. The site map will also help the designer to give a more accurate estimate of the cost, and of the timeframes involved - particularly if it is a complex site with many sections and/or rich media and interactive content.


It is not only in at the planning stage that a site map is of use, though. It is a document that should be kept up to date as the design process develops - there are bound to be changes or additions at some stage, or things that seemed desirable initially, but may turn out a bit superfluous. A clear structure is user friendly, and keeping track of the site map ensures that this goal will be achieved. It will be extremely helpful when new sections need to be added to the site at some later stage!


Eventually, a site map also will be relevant to your search engine optimisation (SEO). Once the site is live, there should be a page that contains links to every page within the website. This will make sure that the robots which crawl the internet on a regular basis for Google and other search engines, will find and index every page that is part of your site. As you will probably have noticed when browsing on the internet, search engine results always return individual pages, rather than web domains - the page a potential visitor finds in Google may well not be your home page at all. So making sure that *every* page that makes your website is accessed by the search robots, and indexed, increases your chances of being found on the net.


Asni: Multimedia Art & Design:: webdesign.asni.net :: www.asni.net

Thursday, April 8, 2010

Of Servers and Clients

Before I delve into more HTML tags - as promised in my last blog - today I would like to have a look at some of the actual pieces of hardware that make the internet possible. What precisely is a web page? What is it that you see on your computer screen when you call up a page, and how does it get there?


At the most basic level, a web page is a HTML file which is being opened in a computer program which has been specifically developed for this purpose: your browser. Whether you use Firefox or Internet Explorer, Safari or Opera, or even an outdated browser like Netscape, they all do the same thing: They find the location of the file you are looking for, and render it out for you the way the web designer has envisioned it (well - at least, most of the time).


What makes a web page a bit different from your usual word document, or spreadsheet, or the holiday shots you downloaded from your photo camera, is that the file is usually not sitting on your own computer. It lives on some computer which may be in the next town, or on the other side of the country, or halfway around the globe. Apart from slight differences in loading speed, you'd never notice the difference.


The computer where the file is stored is called a *server*. You can host your website on your own computer if you have the appropriate computer equipment and software - which can be downloaded for free from the internet, and Macs even come with all the necessary software already installed. One of the disadvantages of doing this is that the computer needs to be connected to the internet 24/7, or else the website will not be available when the computer is not online. There are also security risks, such as that your site might get hacked. For this reason, most websites are hosted by a dedicated web hosting service - for a reasonably small annual fee, you can hire a certain amount of storage space for your website files, and the company provides all the necessary setup, software and security. Usually they also include a regular backup service, which can come in handy for those times when things just go wrong.


How does your browser find the right file, among all the gazillion files that make up today's internet? That is what the URL is for - that little line of text that appears in your browser navigation bar, and starts like this: http:// . "URL" stands for Uniform Resource Locator - a unique tag that tells the browser where the page (the "resource") is located. URL's don't only apply to the main HTML document that is your web page: Each and every file that makes up the page you end up seeing on your screen, has their own unique URL. For instance, if a web page displays an image, that image will be a separate file with its own unique web address, or URL. The file does not even need to be located on the same computer as the main HTML document - a page can display images, or movie, audio or flash files, which are each located on a different computer, in completely different parts of the world.


The browser's job is to locate all these files, pull them down the wires that connect the server with your own computer, and assemble them in such a way that they look nice, and make sense. Not a small job! Your own computer, when it displays a web page, is called a "client" - as opposed to server. In one of my next blogs, I will go into the difference between server-side and client-side web programming, but for now, I will call it a blog post! Otherwise, it might end up being information overload.


Asni: Multimedia Art & Design:: webdesign.asni.net :: www.asni.net

Thursday, March 25, 2010

HTML Basics

This week, I had the pleasure to teach my first class "Online Promotion for Everyone" at our very own Featherston Community Centre - the classes are scheduled to take place once a month, on the last Wednesday of the month, from 7.30 pm to 8.30 pm. The next class will take place on 28 April. The cost is $ 12 per person per session - and they're definitely not only open to Featherstonians! So if you want to get some hands on introduction to web technologies, and how to use them to promote your business and career, do come along. More information here: webdesign.asni.net


As is often the case, the first class turned out a bit different from what I had expected to cover. The participants were very keen to get their hands on to actually building a simple website, so instead of dwelling on the theory, we got very hand-on right away. Participants had written their very own web page by the end of the class!


HTML is all about structure. The code consists of a number of tags which indicate the function and level of importance of each part of the page, and each bit of text or other information within it. At first sight, it might seem as if HTML is just a means to format text - different sizes of text for headlines, sub-headers and paragraphs, bulleted or numbered lists, indented block quotes, and tables. These tags make up a good part of the html we use day by day.


Browsers render these tags in a particular fashion - however, this is different depending on what browser is used. A site written in simple HTML gives the author very little control about the details of the graphic representation, such as what fonts are being used, or the precise size of text and headlines. But the beauty of the language is that if the tags are used correctly, the *structure* of the information will be comprehensible no matter how precisely each browser is programmed to format the tags.


The structure of a basic HTML document is very simple, really. The page opens and closes with the <html> </html> tags - usually this tag includes some information as to which version of HTML is being used, the language, and character set, but it can be used on its own, to tell the browser that this is an HTML document.


The rest of the page consists of two sections - the <head> </head>, and <body> </body>. Inside the <head> tag, there is information as to the content of the following page: keywords and/or a short description inside the <meta> tag, styles used, and script languages, if any. Most of the information inside the <head> does not get displayed - but it is an important section for your search engine optimization.


The only tag inside the <head> which is actually visible in your browser is the <title></title> tag. This is the short line of text which is displayed on top of your browser window when you view a web page. It is also one of the first places search engines look to find out what a web page is about - therefore it pays to pay some attention to finding a good title for each of your web pages.


The <body> </body> tag contains all the information which is actually displayed on your web page. This will be mainly text, as well as images, links to other pages, and other media files such as audio, video or flash animations. The most commonly used tags for text are <p> </p> for paragraph - the main body of text on your page - and the varying levels of headlines: <h1> </h1>, <h2> </h2>, <h3> </h3>, <h4> </h4> and <h5> </h5>. These tags ensure that text is displayed in a comprehensible fashion, with appropriate breaks and whitespace, as well as varying sizes for the headers and sub-headers, even if no other styling information is supplied.


The idea of the different levels of header tags is not so much to give different options for size, but again, to make the function of each headline clear. The <h1> tag should only be used once in each page and contains the main title or headline that is displayed inside your page (this is different from the <title> tag inside the <head> section of the HTML document, which appears on top of your browser window - though it may well contain the same line of text).


<h2> is the first level of section header, which can then be subdivided further into sub-sections with the <h3>, <h4> and <h5> tags. Of course, not all header tags need to be used in every page! Often a <h1> and a few <h2>'s will provide all the structure you need for your page.


(to be continued)


Asni: Multimedia Art & Design:: webdesign.asni.net :: www.asni.net

Friday, March 12, 2010

Size matters

Of the many things a web designer needs to juggle in order to deliver the best possible site, loading times are an aspect that sometimes does not get the attention it deserves.


With broadband connections becoming ever more common, it is easy to be a little cavalier about this aspect, but it pays to remember that not everyone is working on a Macbook Pro with a turbo speed internet connection. In that respect, the fact that professional web designers are likely to work with equipment and setup that is at the more capable and up to date end of the spectrum, sometimes is a bit of a liability.


Loading times are determined not only by the nature of the internet connection (broadband or dial-up, wireless or cable, etc.) - which are largely the choice of each individual consumer. Factors outside the consumer's control also contribute: the quality of the phone lines if it is an ADSL broadband or a dial-up connection, modem speeds, the distance from the server, or how busy a site is at any given time. As a web designer, one has little control over those issues. What the web designer *can* control is the size of the files that make up a web page, which is the third part of the download speed equation.


A regular html document is usually tiny, in terms of byte size. Where the problems arise is when the page includes a lot of images or media files. Video and audio files are notoriously heavy and require special treatment. Images, however, are a standard component of most web pages, both as part of the information that is being presented, and as part of the CSS style that makes the page look pretty.


Browsers only accept certain image formats: JPG, GIF and PNG, with JPG and GIF being the most common. All these image formats save file size by loosing information. JPG files use compression - they calculate averages for areas that are of a similar colour. GIFs and PNGs use indexed colour - only a certain pre-determined number of colour values is preserved in the image. JPGs are generally best for photographs and images that use gradients and smooth colour progressions, while GIF and PNG are appropriate for images (such as logos or fancy text fonts) which use lines and flat areas of the same colour.


Once the colour information is lost, it cannot be retrieved. Incidentally, this fact offers some protection for artists or photographers who are concerned that their images might be used illegally if they are posted on the internet. Generally the quality of images which are used within websites is so low that they are useless for most commercial purposes, such as printing them out. They can still be used on other websites of course - therefore it is advisable to watermark each image with your copyright notice and website url. That done, you can then look at it as free advertising. :)


Downsizing the image to the smallest possibly file size without visible loss of quality is a bit of a balancing act. There are no standard rules for this - what is acceptable depends very much on each individual image, and so it is best to adjust each image individually. A good eye will serve you better than any mathematical formulas! But it pays to make the effort: nothing is worse than a web page that wastes people's time by taking too long to download. Chances are most people will never wait that long!


Asni: Multimedia Art & Design:: webdesign.asni.net :: www.asni.net