What's wrong with this html? - html

My html that starts with:
<html>
<head>
<script type="text/javascript" language="JavaScript1.3" src="js/euDock.2.0.js"></script>
<script type="text/javascript" language="JavaScript1.3" src="js/euDock.Image.js"></script>
</head>
...
Netbeans says on the <head> line:
The tag content is unresolved, expecting one of <ISINDEX>, <BASE>,
<TITLE>, <OBJECT>, <SCRIPT>, <META>, <LINK>, <STYLE>.
Why?

http://w3schools.com/html/html_head.asp
The HTML title Element
The tag defines the title of the document.
The title element is required in all HTML/XHTML documents.
The title element:
defines a title in the browser toolbar
provides a title for the page when it is added to favorites
displays a title for the page in search-engine results
So for example:
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>

Isn't title required within the head?

Related

how does html dom head and body work?

Why does the string hello has background color yellow? Why isn't it black?
<!DOCTYPE html>
<html>
<head style="background-color:black">
<title>Check123!</title>
<h1>Hello</h1>
</head>
<body style="background-color:yellow">
<h1>World!</h1>
</body>
</html>
https://www.w3schools.com/tags/tag_head.asp
Default CSS Settings
Most browsers will display the element with the following default values:
head {
display: none;
}
You should put the page's metadata in the head, so there is usually no need to display it.
You get the color from the parent container of your <h1> title, which is <body>.
What ever the html elements you are creating should come inside body tag only. head is where to give information about the title of the page and where the stylesheet and scripts files exist.i thing you got confused with header and head.
header is a html5 tag that comes inside the body tag
H1 is not in the header. H1 should be written in body. If you do not do this, the browser itself corrects your mistake and transfers it to the body.
https://www.w3schools.com/html/html_head.asp
The <head> element is a container for metadata (data about data) and is placed between the <html> tag and the <body> tag.
HTML metadata is data about the HTML document. Metadata is not displayed.
Metadata typically define the document title, character set, styles, links, scripts, and other meta information.
The following tags describe metadata: <title>, <style>, <meta>, <link>, <script>, and <base>.
Everything you want visible should be in the <body> tag. Your h1 should be inside of a header tag inside your body. The head tag is reserved for meta tags and linking stylesheets.
In your case, it should be:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<header style="background-color:black">
<h1>Check123!</h1>
<h2>Hello</h2>
</header>
<article style="background-color:yellow">
<h3>World!</h3>
</article>
</body>

HTML title tag not showing on website

I have my index.php page with a php include of settings.php right at the top and then under this, standard HTML code:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
</html>
in settings.php i have this script included:
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="https://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
The page title is not showing, however if i remove th jquery file:
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
the title shows fine, no problem.
If i check the source code of the website, the title tag shows fine too but its just not displaying when the jquery file is included
jQuery script should be in and at the bottom of your <head> or in your <body> not before your <html> element. That will create issues beyond your no title.
Try putting your settings.php include at the bottom of your <head>.
The script, and thus the <?php include('...') ?> should be inside your head element.
Try the following:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title</title>
<?php include ('settings.php') ?>
</head>
</html>

W3C markup validation errors

I tried W3C Markup validation with a simple HTML page.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Title</title>
<script src="script/myScript.js" type="text/javascript"></script>
<link href="style/theme.css" rel="stylesheet"></link>
<!--[if lte IE 8]>
<link href="style/themeIE8.css" rel="stylesheet"></link>
<![endif]-->
<noscript>Please enable JavaScript in your browser to view this page properly, to view the basic page of the site click the link main.aspx
</noscript>
</head>
<body class="layout">
<div class="header"></div>
<div class="content"></div>
<div class="footer"></div>
</body>
</html>
and got the following errors
I guess in the noscript tag (or generally in the head tag itself) using DOM elements like a is not okay, Is there any alternative to that? i.e. if script is not found provide a link to a page that doesn't need script
and any idea as to why I am getting the errors for link & body tags? Thanks
link tag doesn't have a close tag, </link>. As such, it's invalid. If you want to close it inline, do it like this:
<link ... />
Also, you need to shift your <noscript> tag inside the body tag and between the head tag as it contains text content.
Reference
Sitepoint Reference
Though, using something like this is valid if you place in the head tag 1.
<noscript><link href="style/theme.css" rel="stylesheet" /></noscript>
1. In a head element, if scripting is disabled for the noscript element
The noscript element must contain only link, style, and meta elements.
In a head element, if scripting is enabled for the noscript element
The noscript element must contain only text, except
that invoking the HTML fragment parsing algorithm with the noscript
element as the context element and the text contents as the input must
result in a list of nodes that consists only of link, style, and meta
elements that would be conforming if they were children of the
noscript element, and no parse errors.
Correct Markup
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Title</title>
<script src="script/myScript.js" type="text/javascript"></script>
<link href="style/theme.css" rel="stylesheet" />
<!--[if lte IE 8]>
<link href="style/themeIE8.css" rel="stylesheet" />
<![endif]-->
</head>
<body class="layout">
<noscript>Please enable JavaScript in your browser to view this page properly, to view the basic page of the site click the link main.aspx
</noscript>
<div class="header"></div>
<div class="content"></div>
<div class="footer"></div>
</body>
</html>
Check you style link which is not right. Style link should be self close. i.e.
<link href=".." rel="stylesheet" />
and because there is written text not linked style or script so it should be under body tag.

why is it saying there is an open 'head' tag when there isn't?

<!DOCTYPE html>
<html>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<head>
<title>temp</title>
<link rel="stylesheet" href="style.css"/>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
<script type="text/javascript" src="this.js"></script>
</head>
<body onload="init()">
</body>
</html>
Do you see more than 1 opening head tag? Because both firefox and the w3 markup validator claim I already have an open head tag before the first one I can see...
The meta tag must be in a head tag. If it isn't, the head tag will be implicitly opened.
Since your meta tag is before your head opening tag, the head tag is implicitly opened, the meta tag is inserted, and then you explicitly open head.
To fix this, move the meta tag to somewhere after you open head (but before you close it).
You need to put the meta description tag inside the element,
search engines, including Google, will not consider as meta description (or other meta tags) something
outside the element.
You need to have correct (X)HTML mark-up, and you need all your meta tags inside the element.

how to disable filepath in titlebar of a html file

in html when the title is not mentioned
<html>
<head></head>
<body>
</body>
</html>
then IE automatically shows filepath of html page. How to disable this function.
And No i dont want to put a title element.
use a blank title
<title> </title>
<html>
<title>Text whtever you want/leave it blank </title>
<head></head>
<body>
</body>
</html>
parse the page and add it if it not included as said by alex