CSS Style Websites

Is there a protocol for how to place the items for css style. Do you always start with HTML then go to body? Has anyone created a cheat sheet to help with listing styles. Does everything go in between the body and /body? Flipping back and forth is frustrating to me and the students. Ideas? Thanks!

Generally speaking, if you aren’t going to do the CSS in the CSS file and you just want to put your style in the HTML, it should go within the opening and closing head tags. If I remember correctly, this would mean that your CSS cannot be applied across multiple pages like it could when placed in the CSS file and linked to the HTML. Does this answer your question or am I off base in my understanding?

I am coding in css style. I guess my real question is does everything go between the href or div or pict and etc…
I was thinking of a one-page layout to explain to kids that HTML always has to be at the top. Then body: then what they want to include. When do you do indents, when do you not do indents. with css style, do you have to key style? It very frustrating for student to travel back and forth between websites when they are working in code.
Sorry, not sure if this makes sense. I do thank you for your response and will do some internet videos to see what I can learn.
Kathy

@kathy.smith, So, I hope I am understanding what you are asking …

CSS can either be a separate document (preferred) or it can be included on the main html page.

If it’s on the main html page and if you group it all together, it would be inside style tags … probably something like this:

    <style>
       body {background-color: red;}
       main {
                 color: black;
                 font size: 12px;
                }
    </style>

Indents aren’t required, but they do make it easy to see where your code is, so they are recommended.
You shouldn’t have to move back and forth between websites, but yes, you do usually put your css in a css document separate from the html. You typically code your html first and then do your css after that, so you would only have to switch to the css document once (after your html is coded).

Also, there is a good website with some good instruction on css here:
https://www.w3schools.com/css/css_intro.asp

If you still have questions, we are happy to help!

Mike

WOW! How did I miss this! Thanks so much. Gaining knowledge by leaps and
bounds.

Kathy

  • “**Pleasure in the job puts perfection in the work.” – *
1 Like