The key takeaways from the document are the main steps a browser takes when loading a webpage and the different ways to include CSS in HTML pages.
The main steps a browser takes when loading a webpage are: 1) Check cache 2) Ask OS for server IP 3) DNS lookup 4) Open TCP connection 5) Send HTTP request 6) Receive HTTP response 7) Check for redirects/errors 8) Cache response 9) Decode response 10) Render response
To create nested tables in HTML, you can place a <table> element inside a <td> element of an outer table. The inner table would have its own <tr> and <td> elements.
HTML:
when type a url what happened?
1. browser checks cache; if requested object is in cache and is fresh, skip to #9 2. browser asks OS for server's IP address 3. OS makes a DNS lookup and replies the IP address to the browser 4. browser opens a TCP connection to server (this step is much more complex with HTTPS) 5. browser sends the HTTP request through TCP connection 6. browser receives HTTP response and may close the TCP connection, or reuse it for another request 7. browser checks if the response is a redirect (3xx result status codes), authorization request (401), error (4xx and 5xx), etc.; these are handled differently from normal responses (2xx) 8. if cacheable, response is stored in cache 9. browser decodes response (e.g. if it's gzipped) 10. browser determines what to do with response (e.g. is it a HTML page, is it an image, is it a sound clip?) 11. browser renders response, or offers a download dialog for unrecognized types How to create nest tables within tables in HTML? We can create nest table i.e. table inside a table. To create table we use following attributes: <table></table>: declare starting and ending of table. <tr></tr>: declare table row. <td></td>: table data. <table> <tr> <td>first cell of the outer table</td> <td>second cell of the outer table, creating second table inside the first table <table> <tr> <td>first cell of the second table</td> <td>second cell of the second table</td> </tr> </table> </td> </tr> </table> Explain Non Breaking space in HTML. When we add many spaces in the content then HTML remove all space except one space this is Non Breaking Space. To overcome this problem we use  . Suppose we want to add 3 space between two words then we have to use   three time. How do I link to a location in the middle of an HTML document? Link to the labeled destination: we can link with the destination in the same URL page and with Different URL page. Same URL: <a href="#Destination"> Visit to destination</a> or Different URL: <a href="thesis.html#section2">go to Section 2 of my thesis</a> How to create a button which acts like a link? To create buttons which act as a hyperlink, there are two ways: <FORM ACTION="[url]" METHOD=get> <INPUT TYPE=submit VALUE="Text on button"> </FORM> <INPUT TYPE="submit" VALUE="Go to my link location" ONCLICK=" http://www.careerride.com/;" /> What is difference between HTML and XHTML? The differences between HTML and XHTML are: HTML is application of Standard Generalized Markup Language(SGML) whereas XML is application of Extensible Markup Language(XML). HTML is a static Web Page whereas XHTML is dynamic Web Page. HTML allows programmer to perform changes in the tags and use attribute minimization whereas XHTML when user need a new markup tag then user can define it in this. HTML is about displaying information whereas XHTML is about describing the information How many types CSS can be include in HTML? There are three ways to include the CSS with HTML: Inline CSS: it is used when only small context is to be styled. To use inline styles add the style attribute in the relevant tag. External Style Sheet: is used when the style is applied to many pages. Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section: <head> <link rel="stylesheet" type="text/css" href="mystyle.css" /> </head> Internal Style Sheet: is used when a single document has a unique style. Internal styles sheet needs to put in the head section of an HTML page, by using the <style> tag, like this: <head> <style type="text/css"> hr {color:sienna} p {margin-left:20px} body {background-image:url("images/back40.gif")} </style> </head> What are logical and physical tags in HTML? Logical tags are used to tell the meaning of the enclosed text. The example of the logical tag is <strong> </strong> tag. When we enclosed text in strong tag then it tell the browser that enclosed text is more important than other text. Physical text are used to tell the browser that how to display the text enclosed in the physical tag. Some example of the physical tags are: <b> , <big> , <i> <i> Defines a part of text in an alternate voice or mood <em> Defines emphasized text <b> Defines bold text <strong> Defines important text Explain marquee tag. Marquee tag: Marquee tag is used when we want that some text or content move in the web page whether horizontally or vertically. Syntax of Marquee tag: <marquee>move text</marquee> Attribute of Marquee tag are: bgcolor, direction, height, width, vspace etc. A marquee allows you to put a scrolling text in a web page. To do this, place whatever text you want to appear scrolling within the <marquee> and </marquee> tags. How do I add midi music to my web page? We can add midi Music in our HTML web page using following tag: <bgsound src="music.mid" loop="1"> Attribute LOOP= 1: shows that music.mid is played only for one time. We can also set the value of loop to infinite. This tag is supported by Netscape and Internet Explorer. Example: <embed src="canyon.mid" Autostart=TRUE Width=145 Height=60 Loop=true> Explain various HTML list tags. In HTML we can list the element in two ways: Ordered list: in this list item are marked with numbers. Syntax: <ol> <li> first item </li> <li>second item </li> </ol> Display as: 1. First item 2. Second item. Unordered Lists: in this item are marked with bullets. Syntax: <ul> <li> first item </li> <li>second item </li> </ul> Display as: -First item -Second item. Explain HTML background. There are two types of background in HTML: Colored Background: in this the background of the html is colored. The Syntax is: <body bgcolor = red> The value of the bgcolor can be set in three ways by hexadecimal number, an RGB value and Color name. Example: <body bgcolor = black> <body bgcolor = rgb(0,0,0)> <body bgcolor = #000000> Image Background: in this we set the background of the website by an image. Syntax used for this is : <body background=study.gif> What is CSS? By using CSS with HTML we can change the look of the web page by changing the font size and color of the font. CSS plays an important role in building the website. Well written CSS file can be used to change the presentation of each web page. By including only one CSS file. It gives web site developer and user more control over the web pages. What is difference between HTML and HTML5? The differences between HTML and HTML5 are: Document of HTML is very large as compare to the HTML5. Audio and Video tags are not present in HTML whereas HTML5 contains audio and video tags. Vector technology is not integral part of HTML whereas HTML5 Vector technology is integral part of it. HTML supported by all old browsers whereas HTML5 is supported by new browser. In HTML web sockets are not available whereas in HTML5 Full duplex communication channel is present. How to insert Javascript in HTML? We can insert JavaScript in HTML using <Script tag>. JavaScript can be enclosed in <script type = text/javascript> and ending with </script>. <html> <body> <script type="text/javascript"> .... </script> </body> </html> What is the Use of SPAN in HTML and give one example? SPAN: Used for the following things: Highlight the any color text For adding colored text For adding background image to text. <p> <span style="color:#000000;"> In this page we use span. </span> </p> URL: Uniform Resource Locator; an address that specifies the location of a file on the Internet. Following is how the basic HTML layout: <html> <head><title>Title of page</title></head> <body>This is my first homepage. <b>This text is bold</b></body> </html> What is tag? In HTML, a tag tells the browser what to do. When you write an HTML page, you enter tags for many reasons -- to change the appearance of text, to show a graphic, or to make a link to another page. HTML- What are the various text formatting tag in HTML? <b>: Defines bold text <br>: Inserts a single line break <center>: Deprecated. Defines centered text <em>: Defines emphasized text <hr>: Defines a horizontal rule <i>: Defines italic text <p>: Defines a paragraph <u>: Deprecated. Defines underlined text <a>: The <a> tag defines an anchor. It can be used to create a link to another document by using the href attribute or to create a bookmark inside a document, by using the name or id attribute. <meta>: <meta> element provides meta-information about your page, such as descriptions and keywords for search engines and refresh rates. <meta> tags always goes inside the <head> element. Metadata is always passed as name/value pairs. e.g: <head> <meta name="description" content="Free Web tutorials"> <meta name="keywords" content="HTML,CSS,XML,JavaScript"> <meta name="author" content="Stle Refsnes"> <meta charset="UTF-8"> </head> What is image mapping in HTML? Making one image link to several pages is called as image mapping. For example, if you have a map of India , then clicking on a state can take to to another page and likewise for other states. How to read and write a file using javascript? There are two ways to do it: 1. Using JavaScript extensions (runs from JavaScript Editor), or 2. Using a web page and ActiveX objects (Internet Explorer only) In JavaScript Extensions, you can use: fh = fopen(getScriptPath(), 0); to open a file Using ActiveX objects, following should be included in your code to read a file: var fso = new ActiveXObject("Scripting.FileSystemObject"); var s = fso.OpenTextFile("C:\\example.txt", 1, true); How to upload file in web browser? These things are necessary for Web-based uploads: * An HTTP server that accepts uploads. * Access to the /cgi-bin/ to put the receiving script. Prewritten CGI file-upload scripts are available. * A form implemented something like this: <form method="post" enctype="multipart/form-data" action="fup.cgi"> File to upload: <input type=file name=upfile><br> Notes about the file: <input type=text name=note><br> <input type=submit value=Press> to upload the file! </form> Is it possible to make the HTML source not viewable? In short, there is no real method or script for making standard HTML source code not viewable. You may consider doing any of the below if they are concerned about your source code. 1. Create the web page in Macromedia Flash or a similar program. The visitor would need to download the Macromedia Flash plug-in and would be unable to view the source code for the flash applet. 2. There are various scripts that will disable the right click feature, preventing the user from saving images or viewing the source. However, this will not protect the source code of your page. For example, Internet Explorer users may still click "View" and "Source" to view the source code of the page, or a user could disable scripts and images can be saved by simply saving the web page to the hard drive. 3. There are several programs that will help scramble your code, making it difficult (not impossible) to read. Again, this is not going to prevent someone from viewing your code. Difference bw GET and POST method: GET method characters were restricted only to 256 characters.But in the case of POST method characters were not restricted. Get method will be visible to the user as it sended appended to the URL, put Post will not be visible as it is sent encapsulated within the HTTP request body. Get method you can only use text as it sent as a string appended with the URL, but with post is can text or binary. How do I rename all the files from .htm to .html after copying them from a PC to a UNIX machine? UNIX's mv (`move') command won't handle wildcard filenames. However, there's a program called htmaddl (for `HTM-add-"L"'), so you can login and type htmaddl. This will rename all .htm files to .html If you haven't got this program on your UNIX machine, you can type it into a file called htmaddl: #! /bin/sh for f in *.htm; do base=`basename $f .htm` mv $f $base.html After saving it and exiting your editor, make it executable by typing the command chmod ugo+x htmaddl Best of all, move it into your ~/bin directory, or ask your WebMeister to put it in /usr/local/bin so everyone can use it. How to transferring user to new web page automatically? You will need to use the below meta tag. <meta http-equiv="Refresh" content="2" ;="" url="http://www.yourname.com"> Placing the above tag in your will load yousite.com in 2 seconds. Changing the 2 value on CONTENT="2" to another value will increase or decrease the delay until loading the new page. Why does the browser show my plain HTML source? If Microsoft Internet Explorer displays your document normally, but other browsers display your plain HTML source, then most likely your web server is sending the document with the MIME type "text/plain". Your web server needs to be configured to send that filename with the MIME type "text/html". Often, using the filename extension ".html" or ".htm" is all that is necessary. If you are seeing this behavior while viewing your HTML documents on your local Windows filesystem, then your text editor may have added a ".txt" filename extension automatically. You should rename filename.html.txt to filename.html so that Windows will treat the file as an HTML document. Can I prevent a form from being submitted again? No. The server-side program that processes the form submission must handle duplicate submissions gracefully. You could generate the form with a server-side program that adds a hidden field with a unique session ID. Then the server-side program that processes the form submission can check the session ID against a list of previously used session IDs. If the session ID has already been used, then an appropriate action can be taken (e.g., reject the submission, or update the previously submitted data). Ultimately, your server-side program must be smart enough to handle resubmitted data. But you can avoid getting resubmitted data by not expiring the confirmation page from form submissions. Since you want to expire pages quickly when they have transient data, you might want to avoid putting transient data on the confirmation page. You could provide a link to a database query that returns transient data though. What is a Hypertext link? A hypertext link is a special tag that links one page to another page or resource. If you click the link, the browser jumps to the link's destination. What is a DOCTYPE? Which one do I use? According to HTML standards, each HTML document begins with a DOCTYPE declaration that specifies which version of HTML the document uses. Originally, the DOCTYPE declaration was used only by SGML-based tools like HTML validators, which needed to determine which version of HTML a document used (or claimed to use). How do I create frames? What is a frameset? Frames allow an author to divide a browser window into multiple (rectangular) regions. Multiple documents can be displayed in a single window, each within its own frame. Graphical browsers allow these frames to be scrolled independently of each other, and links can update the document displayed in one frame without affecting the others. You can't just "add frames" to an existing document. Rather, you must create a frameset document that defines a particular combination of frames, and then display your content documents inside those frames. When is it appropriate to use frames? Frames can make navigating a site much easier. If the main links to the site are located in a frame that appears at the top or along the edge of the browser, the content for those links can be displayed in the remainder of the browser window. Can I have two or more actions in the same form? No. A form must have exactly one action. However, the server-side (e.g., CGI) program that processes your form submissions can perform any number of tasks (e.g., updating a database, sending email, logging a transaction) in response to a single form submission. How do I create a link that sends me email? Use a mailto link, for example, send me email at: <A HREF="mailto:[email protected]">[email protected]</A> What is image map? Image map lets you link to many different web pages using a single image. You can define shapes in images that you want to make part of an image mapping. e.g: <area>: Defines a clickable area inside an image-map <p>Click on the sun or on one of the planets to watch it closer:</p> <img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap"> <map name="planetmap"> <area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm"> <area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm"> <area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm"> </map> Click on the sun or on one of the planets to watch it closer: