Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dbwebsites 1.1 Making Database backed Websites Session 1 Building a simple website by hand.

Similar presentations


Presentation on theme: "Dbwebsites 1.1 Making Database backed Websites Session 1 Building a simple website by hand."— Presentation transcript:

1 dbwebsites 1.1 Making Database backed Websites Session 1 Building a simple website by hand

2 dbwebsites 1.2 How does the web work? A web-server waits for requests from a browser (web-client) When you go to a site your browser sends a request to the web server It sends back the HTML for the page Your browser parses the page looking for other resources it needs (eg images) It requests and receives the additional resources

3 dbwebsites 1.3 HTML Originally designed as a Semantic Markup Language Consists of Head and Body Head contains information about the web page (eg title) Body contains the content of the page itself

4 dbwebsites 1.4 Tags HTML tags markup parts of the page as being head, body, a title, bold, etc. Tags look like…...some stuff… Some tags also have attributes Note, in HTML not all tags close

5 dbwebsites 1.5 A short page A short page Some content for our short page Note: The indenting is not important, but it makes it easier to see the structure of the document.

6 dbwebsites 1.6 The major tags

7 dbwebsites 1.7 Linking pages together Stuff Bother This page will be have links to a page called stuff.html and another called bother.html

8 dbwebsites 1.8 Blue Peter moment Here’s one I prepared earlier… Errr…why does it look awful? We need some style!

9 dbwebsites 1.9 Getting it to look good There are two broad approaches… Using HTML as a layout language (a Bad Thing) …or… Using Semantic Markup (a Good Thing)

10 dbwebsites 1.10 Non-Semantic Markup when used for layout Widely used (even by me), but considered a “Bad Thing”. Don’t do it…use semantic markup instead

11 dbwebsites 1.11 Semantic Markup Use markup to denote the meaning of parts of the document. i.e. Which part is the title, which parts are headings Then use style sheets to control the appearance.

12 dbwebsites 1.12 Style Sheets h1 { font-family: Helvetica; color: #008800; background-color: #ffffff; text-decoration: underline; } div.special { color: #bbbbbb; }

13 dbwebsites 1.13 Style Sheets Inline styles – the tag h1 { color: #ff0000; } External Style sheets tag External styles generally are generally better, unless you want to add one extra style to a specific page, that’s never going to be used elsewhere… Why?

14 dbwebsites 1.14 Colours Look like #ff6790 (which is a pinkish colour) Made up of Red, Green and Blue #RRGGBB Unfortunately in hexadecimal, (base 16).

15 dbwebsites 1.15 Regions here’s some text in a grey region Freaky The appearance of the regions is defined by style sheets.

16 dbwebsites 1.16 Site layout strategies Addressing types Absolute http://www.foo.com/bar.html will work from anywhere. The only option for linking to pages on another site Relative assuming that the page with the link is in the same directory. Will stop working if you move either of the pages. Root Relative assuming the page with the link is on the same server. Will work so long as the target page is not moved. Since sites tend to have lots of links within the site Root Relative is very useful.

17 dbwebsites 1.17 Site layout strategies Use folders to group related pages within a site. The URL can be a useful navigation tool for experienced surfers. Put images that are used all over the site in one place – often in /images/ Site wide style sheets in one place – say /styles/ Resources that are only used for part of a site in subfolders.

18 dbwebsites 1.18 Why does site layout matter? If you’ve written 5 webpages, it probably doesn’t. If you’ve written 5000 and you decide you want to change something… bad layout will toast you. Bad separation of style from content will also toast you since you’ll have to update the style elements on every page.

19 dbwebsites 1.19 Forms! This is where it gets exciting… Some text

20 dbwebsites 1.20 So where does the data go? We’ll come to that in the final week!! For now just use the script “echo.php”

21 dbwebsites 1.21 Questions? Presentation online at… http://people.surfaceeffect.com/pete/ tech/howitworks/dbwebsites/


Download ppt "Dbwebsites 1.1 Making Database backed Websites Session 1 Building a simple website by hand."

Similar presentations


Ads by Google