Old Homework

week 1 homework

week 2 homework

week 3 homework

week 4 homework

week 5 homework

week 6 homework

week 7 homework

week 8 homework

week 9 homework

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

home | homework | links | glossary | sitemap | contact

Week 3 - Homework

1. What is the difference between a relative and absolute URL? Please give an example of each.

An absolute link defines a specific location of the Web file or document including: the protocol to use to get the document, the server to get it from, the directory it is located in, and the name of the document itself. For example: <a href=" http://www.example.com/example.html"></a>

With a relative link, the search engine spiders and browsers already know where the current document is located. Thus, if you link to another document in the same directory, you will not need to write out the full URL. Only the file name is necessary. For example: <a href="example.html"></a>

The domain name or the http://www is not included in this type of link. Using of relative links can decrease a page's download time - less code means a faster download time.

 

2. What is the advantage of managing files, i.e. renaming, moving, and deleting files, through Dreamweaver´s Files Panel?

The Files panel is extremely useful.This is where you can manage all your website files without having to leave Dreamweaver. It works much like Explorer (on Windows) or Finder (on Mac). You can create folders, copy, move, and rename files, and upload and download files to and from your remote server.

filespanel

The Files panel gives you an overview of the entire site and work with the entire site structure. It shows listings of the files in your local root folder and on your server. When you open any document, by contrast, you work on one HTML page at a time, adding and modifying content as necessary.
To delete a file or folder, click once on the item to highlight it then press Delete or Backspace. To rename any file or folder in Files panel view, click on it with the right mouse then choose Edit - Rename from the context menu. You can also click twice on the current name of the item, taking care that the two clicks are on slightly different parts of the name. The name will then be highlighted, ready to be edited.

 

3. What is the significance of a page named index.html?

When you start building your website, you should create your main page and name it index.html. This is true whether you're using a free hosting service or you have your own domain name. That way, when people come to your URL, they automatically get your main page. All other pages will have names like "about.html" or "contact.html", but your home page should file should be called "index.html".

Whenever you have a directory on your website you should have an index.html page. This allows your readers to see a page when they come to that directory without typing a file name in the URL. It also prevents them from seeing things you might not want them to see.

If you don't put in an index.html file in a directory, most Web servers will display a file listing of all the files in that directory. While in some situations, you might want that, most of the time this is ugly at best and a security hole at worst. Writing a default Web page and naming it index.html helps solve those problems.

 

4. What DOCTYPE should you be using for your pages?

A doctype (or DTD – document type definition) is a tag at the very beginning of an HTML document. Using a Doctype tells browsers how they should interpret your code. This means your website will be rendered with better consistency, because browsers don’t have to guess which set of rules to apply. If you make them guess, then they will sometimes guess wrong. The Doctype belongs at the start of the source code, before the html tag. For example, here’s a simple web page:

doctype

The W3C has defined a variety of Doctypes. This might seem a lot to choose from, but it’s easy if we split them into groups.

The first thing you might notice is that you have a choice between HTML and XHTML.

Deciding between HTML and XHTML is not as straightforward. This is much more of a personal preference, with no clearly wrong answer. But probably, using of HTML is almost always a better choice. XHTML may be the future of the web, or it may not. What is clear, however, is that XHTML makes your life harder. You have to serve it to Internet Explorer with a MIME type of “text/html”, which means that IE treats it as invalid HTML and uses error-correction routines instead of simple standards. Also, Google ads won’t work in XHTML without further work-arounds. HTML is not “yesterday’s language”. Almost all web pages on the Internet, be they old or new, are written in some flavour of HTML, and it enjoys much better browser support than XHTML.

The other choice is between Transitional, Frameset, and Strict.

Strict is the best doctype for using hower it is harder for beginners to get right, because you have to write better code. Transitional was intended as a stepping stone to help web designers begin to improve their code. The only reason for using Transitional is that you’re stuck in old habits and don’t yet have time to learn better ways of coding. The Frameset Doctype exists for those designers who insist on using frames. Frames are not allowed in the modern flavours of (X)HTML, for the simple reason that they are not very useful for users (can’t bookmark pages properly), search engines (can’t index your site properly), and for novice coders (easy to get the code wrong, breaking your site).

The best choice for your website is almost certainly HTML 4.01 Strict. Or just use W3C validator.

 

5. Why is <em>and <strong> preferred over <b> and <i>?

Using the <strong> elements favored over using the <b> element for to separate style from structure. Another reason the <strong> tag is preferred is because of HTML semantics. For example, you may want some text to stand out to readers and search engines, but you may not want it to appear in bold. By choosing <strong> over <b>, you are not necessarily telling a web browser that the content should be displayed in bold, thus separating semantics (code that associates a tag with the content it should countain, such as <h1> tags for headings, <p> for paragraphs, etc.) from presentation. The <em> is preferred over the <i> for the same reasons.