The box model applies to every element, but differently between block elements and inline elements. The box model makes the most sense with the block elements: margins, border, padding, content.
For inline elements, width and height are ignored, which almost makes sense. Mostly, I ignore box properties for inline elements.
There are subtler things we'll get into later, but these are the essentials.
No. In fact, in Ottergram, it's not!
It just has to be referenced by the html file. It can even
be on another server, like normalize.css
.
Great question! I think it's helpful to step back and think about setting policy for your site: how do you want headers to look? Sections? Paragraphs?
Then, you can focus in and say, how do I want this particular section to look.
By default, web pages are like an infinite scroll of paper: long and narrow. People don't mind scrolling vertically; they hate scrolling horizontally. We mostly let blocks stack vertically on the page.
Sure. ID is just one kind of selector, and not even the best one. Just the most specific, which is sometimes useful but often not.
In fact, a book I used to use with this course never used an ID selector. They used classes instead, which then can be applied to as many items as they wanted.
It's a fine approach, though it feels weird to me to create a class for something we know is unique.
Because you generally want to set a policy for a kind of thing and use that policy for all of them, rather than having each item treated uniquely.
Sure, but my experience teaching this course is that students are very likely to mis-use an ID. Particularly for dynamic items. We don't have dynamic items yet, but we will later in the course, so we'll re-visit this admonition.
But for the static web pages we have so far, IDs are fine.
I'd be glad to say more about this, especially if you give me some guidance....
I'm glad to hear it!