I have create a CSS external file, it doesn't access with HTML file. why ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I have create a CSS external file, it doesn't access with HTML file. why ?

3rd Mar 2017, 10:23 AM
Ishwarya Manikandan
Ishwarya Manikandan - avatar
6 Answers
+ 7
<link rel = "stylesheet" type = "text/css" href = "myStyle.css" /> it definitely should work. just keep the path correct
3rd Mar 2017, 10:29 AM
Ronit Kumar
Ronit Kumar - avatar
+ 6
no not for new browsers
3rd Mar 2017, 11:04 AM
Ronit Kumar
Ronit Kumar - avatar
+ 4
1> test without path, just putting right name of css file in href attribute, and the css file in the same folder ( directory ) as your html file. 2> if it works, you should correct the path for good targeting the folder where you want put te css file... 3> else, the mistake take place somewhere in your html code, probably around the <head> content, if not precisely at your <link> tag ;)
3rd Mar 2017, 2:30 PM
visph
visph - avatar
0
is the type="text/css" important?
3rd Mar 2017, 10:33 AM
Ishwarya Manikandan
Ishwarya Manikandan - avatar
0
@Ishwarya Manikandan type="text/css" is not needed in HTML5, but it is required in older versions, such as HTML4
3rd Mar 2017, 10:42 AM
DefaltSimon
DefaltSimon - avatar
- 1
i didn't put the id and class. know problem solved.
5th Mar 2017, 9:06 AM
Ishwarya Manikandan
Ishwarya Manikandan - avatar