Hi, I am learning html at w3school. I am trying to work how to put the image in the page but the Image in not displaying. I save the html file in my homepage folder and also image in the same folder. but when I try to open the web page image is not displaying so please help what mistake I am making. Here is the code I am using.
Make sure your images are stored in the same folder as your html page, or try inserting the exact location of the image, i.e.: <img src="http://yourdomain.com/hackanm.gif" width="48" height="48"> Also, you don't specifically need to include the width and height for the image to display.
True. But it is good practice to do so. This is for allowing the browser to allot space for those dimensions before downloading the actual image. Otherwise, you get the pages that loads tons of images and while you are reading content the page starts "jumping" all over the place. Very irritating. Is the filename and extension correct? It probably is, but had to ask. If you would post the Url of the page in question, that would help.
It came from a tutorial. Plus it does not matter. Some utilities like Html Tidy will format your code that way too. Try not to confuse the person with some of the trivial stuff.
You are right this code is from w3school tutorial. I don't know why the image is not working.I saved the image in the same folder where I saved the page. and I created the page on Notepad. Can some one try this code and let me know whats problem while I think everything is according to the rule. Since I am new learner so I am very nervous facing this problem, please help me.
Try adding the the slash at the end: <img src="constr4.gif" width="144" height="50" [COLOR="Red"]/[/COLOR]> Code (markup):
I just thought of something very basic you may have made a mistake with: You said that you typed the code in wordpad. Did you save it and upload it as an HTML file?
Actually, it was Notepad (not wordpad). But that got me to thinking about something else. Is this page on a Web Server at all? If you are trying to view this from your own machine, it is NOT going to work. If it is on a web server, a Url to the page would be nice.
I'm sure.. the person might not have uploaded the file to the server. He must have placed the notepad file, html file, two images in the same folder and was trying out the result, it seems. And there could be no problem with the script.
You are right, I am trying to open in my pc, not hosted in server. I saved the file as Html and didn't save the image twice. I agree, may be it may not work on my pc but it can work on server. I will try to upload it online then it may work. Thanks you so much to all of you guys.
Dear Friend, Html pages designed by Notepad can be displayed online only? I mean the with the graphics? How we can preview offline the Html page designed by Notepad specially the with the graphics?
The term is "view web pages locally". In order to do that, you need to install a web server on your computer. There are installation packages that will install Apache Web Server, PHP, MySQL and Perl on your local machine. Try XAMPP from Apache Friends. Once installed, there is a directory labelled /htdocs/ . . . this is where you will save all of your html files. Browsing to http://localhost in your web browser will pull up the 'index' file in that root directory.
Thanks so much. So complicated.So we cant see the preview when we are designing the Html pages with graphics like Frontpage. If we use Dreamweaver or any other free program can we able to view the page? I heared that in the Dreamweaver we can design the Html webpage?
Most Commercial (FrontPage, Dreamweaver) and Freeware(Html-kit) editors have built-in Html previewers, no web server needed. In order to view scripted pages, such as .php and perl, you will need the web server and the interpreters installed on your machine for local files. Otherwise, you will need to FTP/Publish those pages onto a remote web server.
Try editing your Html with Html-kit. It has a preview tab to look at your work with. It is the only editor that I will endorse. I have been using it for over 5 years and it has everything you will need (including built-in third party TopStyle Lite support) From their website: As mentioned earlier. The preview works for standard Html pages. If you get into scripting with PHP you will need XAMPP (or equivalent) installed on your local machine.
If you are in a content management system you have to be sure to use the full url of the graphic because it isn't always clear how your server with interpret your site's structure. I don't know TypePad, but I had this same problem when I started using wordpress. Also test the image url in a browser window, if the image doesn't come up the problem is with your path not your code.