Why HTML page downloaded as file by browser, not browsing instead? - html

I used next HTML code as page, but Chrome just downloaded this page as file, not browsed as hypertext instead.
Address used: http://127.0.0.1:5151/
What's wrong with it?
<!DOCTYPE html>
<html lang="en" xmlns="">
<head>
<meta charset="UTF-8">
<title>Greeting</title>
</head>
<body>
<h3>Greetings!</h3>
Welcome to the Web Interface.<br/>
<br/>
What action are you want to do?<br/>
<br/>
1. Upload config<br/>
</body>
</html>
Headers used Content-Type: application/xhtml

Check if the file extension is .html instead of .hmlt or something else

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>

How to put a downloadable pdf link in html

this is the code i wrote:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>title</title>
</head>
<body>
Click to download!
</body>
</html>
when I click on the text I it doesnt download the file and it only previews it instead of downloading
Can you write me a proper code ? thanks
You are asking for pdf file and in link txt file is given..
anyways.. no prob...
try
<a href="test.txt" target='_blank' download>Click to download!</a>

How to paste Raw HTML into a README.md using markdown on GitHub?

Editing a README.md for a git repository. But I want to embed raw HTML into the the readme. I'm using Markdown, which is an excellent tool. Yet, the code just keeps showing up as rendered HTML.
How do I keep it Raw?
And formatted like code?
Here it is if you're curious:
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Welcome</title>
</head>
<body>
<h1>Django Site</h1>
<hr />
<p>Thanks for visiting.</p>
</body>
</html>
The heck? It works here.
I suppose you are on GitHub.
GitHub only allows certain HTML elements and attributes inside their markdown: all others are stripped to prevent XSS and defacing.
And of course, <body> is one of the forbidden tags as it would make the HTML invalid if present (a body inside a body)
This is documented at: https://help.github.com/articles/github-flavored-markdown/#html
Use "`" This Sign To Use Raw Code Snippets
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Welcome</title>
</head>
<body>
<h1>Django Site</h1>
<hr />
<p>Thanks for visiting.</p>
</body>
</html>
It Will Allow A User To Copy Your Code Directly From Your README.md File In Github By Just Pressing A Button !!!

Strange behavior of <a> tag

My code says
example.com
But when it comes to the browser, it looks like the following and the link is not working.
<a href="http: www.example.com"="">example.com</a href="http:>
Do you have any idea why this is happening?
Looks like you copied or accidentally added a blank space in the html. Simply set your cursor in front of the a and hit backspace till you hit the < ;-) Rinse and repeat for the closing bracket.
Make sure to specify a doctype and a charset on your HTML file. Also remember to save your file as ".html" or ".htm".
Here is a small example of a basic HTML structure.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Your document title</title>
</head>
<body>
Your code goes here.
example.com
</body>
</html>

External Images does not display when used in img tag

I have these strange image urls that if I call direct in browser, an image shows up but when I use it in an img tag no image shows up.
http://thetvdb.com/banners/_cache/fanart/original/248951-1.jpg
I'm sure I'm making some silly mistake. Here is simple code.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org
/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title></title>
</head>
<body>
<img src="http://thetvdb.com/banners/_cache/fanart/original/248951-1.jpg" alt=""/>
</body>
</html>
Any help?
The TV DB does not want to use their bandwidth to display an image on your site.
We don't allow any kind of hotlinking, you are only allowed to directly download the images and then use them as you see fit, you may not use us as a host.
They have taken steps to prevent you from doing this.
quentin#laptop:~ # curl -e http://example.com/ http://thetvdb.com/banners/_cache/fanart/original/248951-1.jpg
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx</center>
</body>
</html>