Problem about external css | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Problem about external css

for using link tag to add the address of .css file in head, i should put "/" in the last part of link or not? is it necessary? 1. <link rel="stylesheet" href="..."> 2. <link rel="stylesheet" href="..."/>

14th Feb 2017, 11:29 AM
Aref moloughi
Aref moloughi - avatar
1 Answer
+ 4
In Html5, the ending slash isn't valid: self closing tags ( ie. <br> <hr> <img> <css> and so on... are always empty tags ), only require the ending slash with XHtml branch ( based on more strict XML, than SGML for classic branch -- XHtml was abandonned with Html5 ). Browers support it for ascending compatibility ( and bad habits ), but Html validator don't accept ^^ Good practice to keep the usual to avoid them...
14th Feb 2017, 1:20 PM
visph
visph - avatar