Jump to content
e_a_g_l_e_p_i

Help understanding CSS in a one page html doc

Recommended Posts

Hello,

 I have been dealing with html for several years but only on a limited basis, so I know how to get around but don't know the most updated code. I have decided to use W3schools to learn more and specifically CSS, I know what it does and I can learn about it on W3 but one thing I can't find anywhere is a one-page html document, is there a location where the CSS code needs to be placed within the html code? Or can it be anywhere in the html between the body tags?

 

Sound like a very simple question but that lack of knowledge has kept me from learning it, any and all help is very much appreciated.

Share this post


Link to post
Share on other sites

Since I have been going through the tutorial on CSS I see that the CSS is between the <style> tags and in between the <head> and </head> tags is that where the CSS is supposed to go on a one-page HTML document??

Share this post


Link to post
Share on other sites

All internal css IS supposed to go in between <head>...</head> within <style>..</style> tags, this also include links to external stylesheets using <link> tag. The only css styling that is allowed within the body tag is inline styling I.E <div style="color: red">...</div>.

https://www.w3schools.com/css/css_howto.asp

Edited by dsonesuk

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×