How to combine HTML and CSS | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to combine HTML and CSS

So I have started to learn html, I have a pretty good understanding of the language at this point I know basically all the tags and their functions, I have began to learn CSS, but my problem is how do I combine them? Do I just write the code on the same document?

30th Jul 2016, 6:19 AM
John Gunasar
John Gunasar - avatar
5 Answers
+ 1
yes CSS goes between an opening an closing <style> tag In the head tag as follows <head> <style> element{ property:value; property2:value2; } or #element_id { property:value; propety2:value; }</style> </head> you can also store it externally as <link rel="stylesheet" type="text/CSS" href="my file.css">
30th Jul 2016, 11:13 AM
josh mizzi
josh mizzi - avatar
+ 1
The best approach is in an external file (style.css). This will make it very easy for you to edit a style that applies to several HTML documents by just editing one single file instead of editing all the HTML documents one by one.
30th Jul 2016, 3:21 PM
ZinC
ZinC - avatar
0
@taghut, go play somewhere else and stop calling people liers.
30th Jul 2016, 3:16 PM
ZinC
ZinC - avatar
0
After doing all this, how do I save it?
8th Apr 2021, 6:08 PM
Sulemana Fusheini
Sulemana Fusheini - avatar
- 1
first open terminal emulator in your smartphone (or something like that) and write su if you using apple phone enter default password is : alpine and write : reboot (and enter) wait after device reboot you will get pop up notice "Congratulation now you are a master of lie." thanks
30th Jul 2016, 6:38 AM
thagut kafir
thagut kafir - avatar