Why aren't my pictures appearing in HTML? - html

<html>
<head><title>Real.com</title>
</head>
<body bgcolor= “white” text=“red”>
<h1>welcome to my site!</h1>
<h2>Welcome</h2>
<p> |Home|
<b>Welcome</b></p>
<center><img src=“john_hancock.jpg” width=“400” height=“500” alt=“john_hancock”></center>
<br>
<a href=“home.html” style=“color:red;”>Home
<body>
</html>
I am trying to upload an image to the website and is trying to create the code for fun, and I am not sure where its going wrong?
Both the file and Image are both in the same directory as well!
Thank you for your help in advance!

You use bad quotes, use " instead of ”. In whole document. Try to find replace all in your text editor.
Image tag will be:
<img src="john_hancock.jpg" width="400" height="500" alt="john_hancock">

syntax error change any “ ” to ""

You used bad quotation marks. Use " instead of ”.
The proper image tag would be: <img src="john_hancock.jpg" width="400" height="500" alt="john_hancock">
Whenever you are not sure where your error is, consider using the w3c HTML-Validator! https://validator.w3.org/
It will tell when your html file contains errors.

1) You're are using the so-called typographical quotation marks (“ and ”) while you ought to use the so-called neutral quotation mark (").
2) The img tag needs to be closed, like so:
<img src="image.jpg" />
3) You haven't closed your anchor tag.

Related

Hello, first question on here. I've been trying to put a image in my website but it isn't working and I just can't figure out the reason. My code HTML

<body style="background-color:#23272A;" <img src="https://drive.google.com/uc?id=1wzC2IUozmJdeX6WlL3hP40e2V5xRm3AH" alt="Bling logo"
width="190" height="120">
<hr>
<h1>bert is corn</h1>
<hr>
With the code I am trying to display a logo to represent the website. The code here only involves the logo. Please help if you can. Thanks
You have two problems.
First, a typo. You forgot to end the <body start tag with a >.
Second: The value of the src attribute has to be a URL pointing to an image.
The URL you are using points to an HTML document.
Google Drive is a file storage service, not a web hosting service. It isn't designed for your purposes. Find somewhere else to store your image files.
this is a very basic error, you forgot to close the tag.
<body style="background-color:#23272A;"> <img ......
---------------------------------------↑
You have not closed the <body> tag
<body style="background-color:#23272A;">
<img src="https://drive.google.com/uc?id=1wzC2IUozmJdeX6WlL3hP40e2V5xRm3AH" alt="Bling logo"
width="190" height="120">
<hr>
<h1>bert is corn</h1>
<hr>

HTML img src format?

I have an API that I can get a "snapshot" from my IP camera. If I use this line my browser returns and image.
http://my_NAS_IP:PORT/webapi/entry.cgi?camStm=1&version="8"&cameraId=1&api="SYNO.SurveillanceStation.Camera"&preview=true&method="GetSnapshot"&_sid=SESSION_ID
but when I try to put this into an html it doesn't work.
<!DOCTYPE html>
<html>
<body>
<img src="my_NAS_IP:PORT/webapi/entry.cgi?camStm=1&version="8"&cameraId=1&api="SYNO.SurveillanceStation.Camera"&preview=true&method="GetSnapshot"&_sid=SESSION_ID"
/>
</body>
</html>
To many " in the line? How can I format this to give me an image on the page?
Yes, you cannot use " character inside a quote that is surrounded by ". Use single quotes ' for the outer string.
Just enclose your img tag in single quotes
<img src='my_NAS_IP:PORT/webapi/entry.cgi?camStm=1&version="8"&cameraId=1&api="SYNO.SurveillanceStation.Camera"&preview=true&method="GetSnapshot"&_sid=SESSION_ID'/>
<img src="my_NAS_IP:PORT/webapi/entry.cgi?camStm=1&version='8'&cameraId=1&api='SYNO.SurveillanceStation.Camera'&preview=true&method='GetSnapshot'&_sid=SESSION_ID"
/>
Use single quotes within ...

External CSS Not Working, possible syntax error? [duplicate]

I'm new to HTML and have a quick question with regards to images. Below I have a simple html file I was playing around with. I wanted to put an image into it which is stored in the home directory of my site. The site is local, on my macbook.
<!DOCTYPE html>
<html>
<body style="background-color:yellow;">
<h1>My First Heading</h1>
<p>My first paragraph.</p>
<p style="color:blue;margin-left:20px;">This is a paragraph.</p>
<p style="background-color:green;">This is a paragraph.</p>
<img src=“HoneyBadger.jpg” alt=“Grumpy honey badger”>
</body>
</html>
However when I open the file with my browser I see a broken link. If I look at the URL of the image in my browser it is,
file:///Users/admin/Sites/project_honey_badger/%C3%A2%E2%82%AC%C5%93HoneyBadger.jpg%C3%A2%E2%82%AC%C2%9D
Some random percent signs and text have been added in? Any idea what I am doing wrong?
Thanks
Look at the syntax highlighting Stackoverflow has added. You are using “ (U+201C: LEFT DOUBLE QUOTATION MARK) and ” (U+201D: RIGHT DOUBLE QUOTATION MARK) where you should be using " (U+0022: QUOTATION MARK).
This is usually caused by writing HTML using a word processor (with automatic replacement of straight quotes with typographic quotes turned on) instead of a text editor.

Image is not being displayed in chrome browser

I am a beginner in HTML and was trying to run a code to display image in chrome browser using "textedit" (Mac).
<!doctype html>
<html>
<head>
</head>
<body>
<h1> Image addition </h1>
<p> <img src=“/Users/aman.kumar/Desktop/HTML/HTMLImage/aman.jpg”> </p>
</body>
</html>
However the image is not being displayed. attaching the screenshot of image in browser. Please helpenter image description here
I tested your code and caugth the error where you are doing mistake. You need to change double quotes to "" instead of ““ for src attribute.
Correct Syntax:
<img src="/Users/aman.kumar/Desktop/HTML/HTMLImage/aman.jpg">
Just copy this syntax from here and paste in your html page. you will get output.
You need to put a URI scheme at the beginning like file:// to tell the web browser to look on the hard drive instead of requesting the image from the internet.
So the img src should look like
<img src="file:///Users/aman.kumar/Desktop/HTML/HTMLImage/aman.jpg">
Just replace the qoutations you used in the img src
“ ”
with
" "
Please remove the fancy quotes use this.
<img src="file:///Users/aman.kumar/Desktop/HTML/HTMLImage/aman.jpg" alt="aman image">
enter image description hereThank you all for your comments, I tried each and every suggestions but didn't work. But accidentally tried the below mentioned code it worked.
Is it because of the gaps in /HTML Image/ and since the gaps have been filled with %20 it worked.
What could be the reason for same?

A "_" every-time i use a <a href code

... <img src="/PhpProject1/vital1_top_logo.jpg" height="180" border="0px" > height="180" border="0px" " >
type="text/css" rel="stylesheet" /> ...
</head>
Every time i use this tag appears a "_" on the right of the image
The code you pasted is borked (double quotes at the beginning of href and an extra '>' in the middle of the img tag) so I'm guessing this isn't a real example. My guess is that you have some kind of whitespace between your img tag and the end of your a tag, like so
<img src="..">
which will show up as an underlined space. The whitespace might be a newline too mind you, so you should always keep them tight. For example, the following will produce the same problem
<a href="..."><img src="...">
</a>
HTH.
<a> and <img> are not allowed in <head>
Try:
<img src="/PhpProject1/vital1_top_logo.jpg" height="180" border="0px" />
It might help if you'd stick to the HTML syntax, right now this snippet is just gibberish. I tried cleaning it up, but then there's almost nothing left that makes sense.
You added two double quotes:
<a href=""http:
Use a single one
<a href="http: