Create a webpage using HTML and CSS code to design a webpage as the layout displayed below:
The top section display the heading, 'Tourist places' in header. The section on left has the list of cities. The right hand side displays tourist places of any one of the cities.
Use inlined style sheet in the top section to display background color for the text 'Tourist places'. Use internal stylesheet for left and right section with background color and font styles.
Answers
Answer:
Part I provided a general overview of the web design environment. Now that we’ve covered the big concepts, it’s time to roll up our sleeves and start creating a real web page. It will be an extremely simple page, but even the most complicated pages are based on the principles described here.
In this chapter, we’ll create a web page step by step so you can get a feel for what it’s like to mark up a document with HTML tags. The exercises allow you to work along.
This is what I want you to get out of this chapter:
Get a feel for how markup works, including an understanding of elements and attributes.
See how browsers interpret HTML documents.
Learn the basic structure of an HTML document.
Get a first glimpse of a style sheet in action.
Don’t worry about learning the specific text elements or style sheet rules at this point; we’ll get to those in the following chapters. For now, just pay attention to the process, the overall structure of the document, and the new terminology.
A Web Page, Step by Step
You got a look at an HTML document in Chapter 2, but now you’ll get to create one yourself and play around with it in the browser. The demonstration in this chapter has five steps that cover the basics of page production.
Step 1: Start with content. As a starting point, we’ll write up raw text content and see what browsers do with it.
Step 2: Give the document structure. You’ll learn about HTML element syntax and the elements that give a document its structure.
Step 3: Identify text elements. You’ll describe the content using the appropriate text elements and learn about the proper way to use HTML.
Step 4: Add an image. By adding an image to the page, you’ll learn about attributes and empty elements.
Step 5: Change the page appearance with a style sheet. This exercise gives you a taste of formatting content with Cascading Style Sheets.
By the time we’re finished, you will have written the source document for the page shown in Figure 4-1. It’s not very fancy, but you have to start somewhere.
We’ll be checking our work in a browser frequently throughout this demonstration—probably more than you would in real life. But because this is an introduction to HTML, it is helpful to see the cause and effect of each small change to the source file along the way.
Before We Begin, Launch a Text Editor
In this chapter and throughout the book, we’ll be writing out HTML documents by hand, so the first thing we need to do is launch a text editor. The text editor that is provided with your operating system, such as Notepad (Windows) or TextEdit (Macintosh), will do for these purposes. Other text editors are fine as long as you can save plain-text files with the .html extension. If you have a WYSIWYG web-authoring tool such as Dreamweaver, set it aside for now. I want you to get a feel for marking up a document manually (see the sidebar HTML the Hard Way).