+ 2
If i am ending head before title then also its working same ?? Then what's a difference ??
<html> <head> <\head> <title> <\title> <body> <\body> <\html> and <html> <head> <title> <\title> <\head> <body> <\body> <\html> are these both are same ?? if not then why their working same in my laptop ??
6 ответов
+ 15
It's a bad practice. Information that are not shown in the browser should be in head.
If you right click in the browser window and select "view page source ", you'll notice that the browser will mark the title tag in red color.
+ 9
@Ashiesh Watts, try the latest version of Firefox.
+ 7
It's mainly depends on browser: Html is permisive ( purpose is to display Html page content as well as possible ), so browsers try to correct incorrect code silently... In major cases, <title> outside <head> may probably be corrected and moved into <head> internally... but it's more than 'bad' practice, it's 'wrong' practice, and should be avoided, as you cannot predict behavior in such cases ^^
+ 4
As Visph said, it might work in some cases, but it becomes unpredictable and it might not work on some browsers.
Besides that, you can get used to writing bad HTML and then the problem escalates.
+ 3
Thank u Sir (Wisdom nd visph )... Actually I am new in coding and I am using Chrome browser it is not showing difference even in "view page source" also...So Please Guide which browser should I use instead of this....will be very thankful to you
+ 2
@Wisdom Abioye....Thank u Sir...it's working