why is my code not showing image as a link in html - html

<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<img src="DFDD.png">
</body>
</html>
the image is not showing while using links is there something wrong with it, the image is in the same folder...i am using brave browser...the webpage is when run completely blank....really can't figure out whats wrong with it
//this problem occurs only while using the live server extension of vs-code..

try to use ./YOUR_IMAGE_NAME instead of just YOUR_IMAGE_NAME. I hope it will work.

Related

Why does my html file not show up in Chrome?

So I started learning HTML today and the first file I coded does not come up in Chrome after being formatted. This is what the code looks like:
<!DOCTYPE html>
<html>
<head>
<title>Nikolay's Website</title>
</head>
<body>
</body>
</html>
And after I tried opening the file, which is of type "Chrome HTML Document" btw (thought it might help as info), it shows a blank page with no heading. Even if I remove the code and type "Hello World" it would still show a blank page in my browser.
HTML page should have the following default structure. Please refer this link https://www.w3schools.com/html/default.asp
<!DOCTYPE html>
<html>
<head>
<title>Nikolay's Website</title>
</head>
<body>
Hello World
</body>
</html>

Text align in CSS does not seem to function on VSCODE

I am making a survey and I need to centre the h1 in the centre of the page. It seems to work on Codepen.io but doesn't seem to work on VS-CODE.
This is my HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Milkshake Survey 2020</title>
</head>
<body>
<h1 id="MS">Milkshake Survey</h1>
</body>
</html>
and CSS:
#MS {
text-align:center;
}
It seems to have worked on code.io
link: https://codepen.io/abhirajsb/pen/xxVgGwj
But on VSCODE it does not seem to work and the title is always on the left.
I need to know what mistakes i am making. (i am a beginner)
I had to include a link in my HTML file to connect the HTML page to the css.
<link rel="stylesheet" href="survey.css">
Thank you to #rioV8 for the quick response and others for the contribution.

When i run my html code it appears blank in chrome (html)

I have a very simple code but when I go running it in chrome it's blank. Other files work fine. I do not know what to do;
Move the Title inside Head
and Close the tag.
If still doesn't work, refer following code:
<!DOCTYPE html>
<html>
<head>
<title>Future Technologies: Asteroid Mining</title>
</head>
<body>
<p>Asetroid Mining</p>
</body>
</html>

Trivial HTML site not showing an image

This one got me really stumped. I have stripped a problematic website of basically everything, being left with the most trivial barebone site you can imagine:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test site</title>
</head>
<body>
<img​ src​="http://placekitten.com/200/300" />
</body>
</html>
...and yet, the img tag doesn't work. I get an empty website - and the W3 validator throws errors like Element img​ not allowed as child of element body in this context. (Suppressing further errors from this subtree.). What am I doing wrong? I have no idea what can be causing issues in a markup that consists of basically no elements other than the img and the ones required.
<!DOCTYPE html>
<html>
<body>
<img src="http://placekitten.com/200/300" alt="W3Schools.com"
style="width:104px;height:142px;">
</body>
</html>
As mentioned in the comment, there were 2 invisible characters after img and src.
I used text-compare to figure out this, please refer the attached screenshot.

HTML showing a broken image

I know the question has been asked a million times, but I just can't find any explanation to the following issue: I've inserted an image in my code, and when I open the page in my browser, I'm just having a broken link.
Here is my code:
<!doctype html>
<html>
<head>
<title>Laura Caroline’s Portfolio</title>
<link href=“/teststyle.css” type=“text/css” rel=“stylesheet”/>
</head>
<body>
<h1>About me</h1>
<p><img src=“portrait.jpeg”/></p>
</body>
</html>
The photo is in the same folder than the page. I've double checked the name.
I'm on MacOS Sierra (if of any help). Oh, and I'm a beginner :) Any clue about where to look to fix this?
Thanks!
As I can see make sure it's in the same directory. Try adding './file.jpg'
About the quotation marks they don't really look like the standard ones. So try replacing that with ""