+ 3
Do I Type Html5 and CSS On the Same Sheet? And, If So Then How?
Recently, I began learning to code & I'm well...still learning. And, while I usually use websites like Dash.generalassemb.ly or www.Sololearn.com which will automatically update the code so you can see what the output of it is (well Dash does) as you type it, and while it separates coding languages such as HTML and CSS in different tabs you can swap to, unfortunately things like Notepad or Notepad++ do not. So I'm wondering is there any way to combine the codes together (Html on 1 tab, CSS on another)?
7 odpowiedzi
+ 4
You can combine HTML and CSS in one file. In your html, between the <head> section, put your css like this:
<head>
<title>...</title>
...
<style>
your css code here
</style>
</head>
But the better way is to work with two files: a html one and a css one.
To do this in notepad just link your css file in your html file. Open your html file and, between the <head> section, put the path to your css file:
<head>
<title>...</title>
...
<link rel="stylesheet" href="path/your_file.css">
</head>
One more thing: instead use notepad or notepad++, try the sublime text editor. Google for it.
Good luck!
+ 2
Yes, you can write css in html in your head element
<head>
<style>
.someClass{
color: blue;
}
</style>
</head>!
+ 1
Thiago your answer is really really helpful, I knew about inserting CSS into HTML for example by using <style> *CSS goes here* </style> into it, or doing <p style="CSS goes here ", but the last where I put it on a new sheet seemed cumbersome and unnecessary to me. And, it seems that way still but I'm sure that as I practice with CSS more as far as separating them on two different sheets it will become easier to understand why that way is both more efficient and effective. Nonetheless, I checked into things like Sublime and Atom but people said that Notepad++ was the way to go... and it's kind of confusing because I'm new so I just sitting here wondering...
+ 1
oh yes I got it what you said I understood you are asking that here in code playground should you place your code using style tags then answer is yes you can it is no problem or you can write it in css too
+ 1
Oh ok thanks Sandeep, I will really keep that in mind haha. I suppose coding becomes easier as you practice more and more.
0
Ordens I really thank you for your answer as well, but I'm wondering do I need to list div. for the HTML portion?
0
sorry BrightAsTheStars, what do you mean by "do i need to list div"? i don't get you