Posts

Showing posts from July, 2019

:first-child isn't

It's really first sibling . It isn't used on the element that has the children. And it only counts if the first sibling happens to be the kind of element that the :first-child pseudo-class has been added to. So blorf:first-child selects all the blorf elements which are first among their siblings.

"rem" is "hem"

For anyone else who has ever felt a moment of uncertainty over whether the font size which defines the rem  is on the html  tag or the body  tag, rem is html's em .        "rem is hem." It isn't a Bug Eyed Monster. Also the "root" seems easier to remember in JavaScript: Document.documentElement  returns the  Element  that is the root element of the  document  (for example, the  <html>  element for HTML documents).

Learn grid and grid-template-areas FIRST!!!

If you're starting to learn web design, you will see hundreds of tutorials about floats clear-fix and positioning and other infinitely painful details on how to actually get HTML and CSS to lay things out in seemingly normal and obvious ways. You'll probably have to learn some of that. But don't learn it first! Instead , read this  https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Grids And then read this  https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas and a longer tutorial here  https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout/Grid_Template_Areas Then lay out your web pages as if layout was something we were actually allowed to do. (And then go back and learn some of the painful stuff later. Or if enough time has passed, maybe you won't have to.)

node-sass

npm install node-sass Add to  scripts in package.json :     "scss": "node-sass --watch scss -o public" --watch points to the directory to watch for changes -o       is where the compiled .css files will be written npm run scss

If h1 is a title, is h2 a subtitle?

The answer: No. Screen readers, etc., expect h1, h2, h3, h4, h5, and h6 to work like a table of contents for the page. A subheading, subtitle, alternative title. or tagline is not a lower-level heading. It doesn't identify any content. It's either part of the heading, or it's just content. So if the user should see/hear/etc. the sub-thing as part of the heading (i.e. if it should be visible in a table of contents) then include it inside the h*  tag and then style it differently. Or if the sub-thing is too large or unimportant to appear in a table of contents, then wrap everything in a header tag, and mark the sub-thing as a paragraph... and style to taste. https://www.w3.org/TR/html52/common-idioms-without-dedicated-elements.html#subheadings-subtitles-alternative-titles-and-taglines