Why does the <!DOCTYPE html> tag stop my program working properly | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why does the <!DOCTYPE html> tag stop my program working properly

I posted a program using CSS3 to draw a car using simple shapes. it starts with the opening tag <!DOCTYPE html> and it works perfectly. However when I run it on my PC I have to remove !DOCTYPE and just use <html> otherwise the blur effect in front of the headlights does not work. Everything else does. I also found the same problem with a program using javascript to randomly change the style of the border. If I use the <!DOCTYPE html> No border is displayed and yet it works perfectly on SoloLearn. Can anyone explain this ?

20th Jan 2017, 4:41 PM
Glenn Morris
Glenn Morris - avatar
1 Answer
+ 3
<!DOCTYPE> tag is the information of what version of Html should follow the parser ( browser )... Without it, the parser will pass in a 'quirck' mode, for attempt to display as better it can the document... so you lost functionalities, as with older version of Html in addition to possible incompatibilities whose may broke your layout ^^
20th Jan 2017, 4:59 PM
visph
visph - avatar