Professional Documents
Culture Documents
Web Designing
Sanchit Mittal, IIT Bombay
Index
Introduction to Web Designing Index Introduction to this document History of the Web HTML: the Language of the Web Tag Diagram Where/How to write this HTML code? Still in Confusion about basics on HTML ? Complete your HTML learning quest from:: CSS (Cascading Style Sheets) Complete your CSS learning quest from:: The Power of CSS JavaScript (Make your page, dynamic :) ) Are Java and JavaScript the same? Put a JavaScript into an HTML page Scripts in <head> Example Complete your JavaScript learning quest from:: Get a Feel of Javascripts from these examples: A Free Book on Javascript: Frequently Asked Questions Resources Making a Real Website Sample Problems (do atleast one problem, if you cant manage time for both) Your Project Problem Quizes
* The language itself is fairly simple and follows a few important standards. * Firstly, document description is defined by "HTML tags" that are instructions embedded within a less-than (<) and a greater-than (>) sign. To begin formatting, you specify a format type within the < and the >. Most tags in HTML are ended with a similar tag with a slash in it to specify an end to the formatting. For example, to bold some text, you would use the following HTML code: this text is not bold <b>this text is bold</b> this text is not bold * It is important to note that the formatting codes within an HTML tag are case-insensitive. Thus, the following two versions of the bold tag would both be understood by a web browser: <b>this text is bold</b> this text is not <B>this text is bold</B> * You can also compound formatting styles together in HTML. However, you should be very careful to "nest" your code correctly. For example, the following HTML code shows correct and incorrect nesting: <CENTER><b>this text is bolded and centered correctly</b></CENTER> <b><CENTER>this text is bolded and centered incorrectly</b></CENTER> * In the incorrect version, notice that the bold tag was closed before the center tag, even though the bold tag was opened first. The general rule is that tags on the inside should be closed before tags on the outside. * Finally, HTML tags can not only define a formatting option, they can also define attributes to those options as well. To do so, you specify an attribute and an attribute value within the HTML tag. For example, the following tag creates a heading style aligned to the left: <H2 ALIGN = "LEFT">this text has a heading level two style and is aligned to the left </H2> * H2 is a html tag used to create Heading text as you will see later. * Finally, you should know that web browsers do not care about white space that you use in your HTML document. For example, the following two bits of HTML will be displayed the exact same way: This is some text that is displayed as you would expect
This
is some
text
that is displayed in a way you would not expect: exactly the same as the above
Tag Diagram
You may have noticed that HTML tags come in pairs; HTML has both an opening tag (<tag name>) and a closing tag (</tag name>). The only difference between the opening and closing tags is that the closing tag contains an extra forward slash.
Some EXAMPLE HTML tags that might make things clearer: <b> Makes text bold </b> <i> Makes text italic </i> <h1> Tells the browser that this text is very important -the browser usually makes this text really big </h1> <table> Creates an HTML table - think of a spreadsheet </table> I hope you can see the pattern in the list above. HTML tags are not just for placing and formatting text, HTML tags can be used to include other things like: animation, video, Flash, audio, and even multimedia programs.
in your mypage.htm file, write ony this: <Html> <Head> <Title> My First Page </Title> </Head> <Body> <h1> Harry Potter - 7</h1> <h2> About the Book </h2> <p>The novels revolve around <b>Harry Potter</b>.</p> <p> This wizard born is sent to wizarding school to learn the magical skills. </p> <h2> About the Movie </h2> Rowling <u>sold the <i>film rights</i></u> of the first four Harry Potter books to Warner Bros. for a reported 1 million . </Body> </Html> That means you type in the HTML code yourself in notepad or similars. This is the approach we are going to use here, because it's the quickest way to learn how to build web pages, and it is arguably the best way because you have the most control over what you're doing. What we are not dealing with this time is 1). Using a pre-made template. (ie all html codes will be there, you need to fill your text) 2). Using a Html Editor like Frontpage or Dreamweaver. (such softwares helps us make webpages easily, as a piece of cake, like formatting a word document.) Ok, now that we know the advantages of hand-coding web pages, let's start a systematic way of learning HTML language.
mechanism that allows authors and readers to attach style to HTML documents. It uses common desktop publishing terminology which should make it easy for professional as well as untrained designers to make use of its features. Visual design issues, such as page layout, can thus be addressed separately from the web page logical structure. Advantages:: CSS saves time When most of us first learn HTML, we get taught to set the font face, size, colour, style etc every time it occurs on a page. This means we find ourselves typing (or copying & pasting) the same thing over and over again. With CSS, you only have to specify these details once for any element. CSS will automatically apply the specified styles whenever that element occurs. Pages load faster Less code means faster download times. Easy maintenance To change the style of an element, you only have to make an edit in one place. Superior styles to HTML CSS has a much wider array of attributes than HTML. // The syntax is something like this.. body { background-color:yellow; } h2 { color:blue; } What this code will do is 1). To Body Tag :: will make its background color to be yellow. 2). To all H2 Tags in the Html code :: will make headings color blue. Let me go very brief and just give you a working example (How to implement CSS): 1). Copy the following Html Code in notepad. Save it as yourname.htm <html> <head> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <h1>This header is 36 pt</h1> <h2>This header is blue</h2> <p>This paragraph has a left margin of 50 pixels</p> </body> </html> 2). Copy the following CSS Code in notepad. Save it as style.css
body { background-color:yellow; } h1 { font-size:36pt; } h2 { color:blue; } p { margin-left:50px; } 3). open your yourname.htm in Web Browser, by just double cliking it.
Complete your CSS learning quest from:: http://www.w3schools.com/css/css_intro.asp (Official Tutorial, a must read) http://tizag.com/cssT/ (Yet Another Fine tutorial) The Power of CSS
If you have any doubts over how powerful CSS really is, then you need to visit CSS Zen Garden. CSS Zen Garden is a display of the power and beauty of CSS. The concept is simple: see how many ways designers can take the exact same HTML code and produce completely different looking pages. As you browse through the various designs, you will find that the only thing changing the way each page looks is the CSS file. The HTML is exactly the same. CSS Zen Garden is a great showcase of creativity and technical expertise. It is also important to point out that CSS Zen Garden does not use any tables for their layout. Everything is done in pure, simple HTML and CSS.
Scripts in <head>
Scripts to be executed when they are called, or when an event is triggered, are placed in functions. Put your functions in the head section, this way they are all in one place, and they do not interfere with page content.
Example
<html> <head> <script type="text/javascript"> function message() { alert("This alert box was called with the onload event"); } </script> </head> <body onload="message()"> </body> </html>
Resources
As making websites is nothing but mainly codes, if you copy-paste code from one site to your own site, it will smoothly run as per requirements (provided you have added it correctly). But due to copyright issues and similar you cannot copy codes or matter without permission, so I am providing some resources/websites which lets you legally use some already existing codes. Please don't use them excessively, don't let it cover your ultra innovative mind. 1 For Javascript: http://jsmadeeasy.com
Sample Problems (do atleast one problem, if you cant manage time for
both)
Please do the sample problems and discuss/show to me before the presentation. This discussion will be through emails, my id is sanchitml@gmail.com
>>www.jokesandpuns.co.cc (Little, but surely deviates from standard menu) < The Project Problem will be revealed in the presentation on 23rd Jan, as there some things i want to discuss with you before giving the problem statement. I assure you, it will be great fun, and exposure opportunity for you. >
Quizes
If you have some time, you can see these questions in HTML, CSS and Javascript. There are about 20 questions in each language. Quite easy ones, seems fun to attempt. HTML: http://www.w3schools.com/html/html_quiz.asp CSS: http://www.w3schools.com/css/css_quiz.asp JavaScript: http://www.w3schools.com/js/js_quiz.asp