Hey guy do you need like a separate file for the CSS code if you are doing html? Or do you just put it at the top or something | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hey guy do you need like a separate file for the CSS code if you are doing html? Or do you just put it at the top or something

12th Aug 2018, 12:02 PM
TwoFiftySix
3 Answers
+ 3
Its good practice to keep it separate and link it in head tag. Because as your code becomes bigger and bigger it will be difficult to find an small error also , if you keep all together. Hope this helps☺️☺️.
12th Aug 2018, 1:00 PM
Meet Mehta
Meet Mehta - avatar
+ 2
PUTTING YOUR CSS IN AN EXTERNAL FILE IS MORE BETTER THAN OTHERS. IT MAKES YOUR CODE BETTER FOR FIND ERRORS IN BOTH HTML & CSS. • If you put your css in external file add a link in head tag like 👇 <link rel="stylesheet" type="text/css" href="file_path"/> It is good practice to keep css in external. Some times It will improve the loading speed of your file in browser.... Happy CODING.......
12th Aug 2018, 1:19 PM
Joshua Raison
Joshua Raison - avatar
+ 1
Both options are available. For css styles inside html , use the styel tag. Otherwise refer to an external css file in the head tag using the link tag. You can also inline the styles for each element
12th Aug 2018, 1:00 PM
Anurag E K