typesetting_on_the_web_course

Contact

Stephen Cronin Senior Developer The Outline.com Personal Website Email - cronin4392@gmail.com Twitter - @cronin4392

Lessons

Links

Learning

Tools

Inspiration

Things to read

Newsletters

Fonts


Quirks

  • Setting all caps type
    • This can require you to "pull" the bottom up
  • Having large letter-spacing can cause extra space on the right
  • Difference between line-height and leading.

Code

Snippets

Center

Better box-sizing

html {
  box-sizing: border-box;
}
*,
*:before,
*:after {
    box-sizing: inherit;
}

Responsive image

img {
    max-width: 100%;
    height: auto;
}

Horizontal center block element

.center-me-horizontally {
    display: block; /* not required */
    width: 680px; /* adjustable */
    margin-left: auto;
    margin-right: auto;
}

Centering children

.parent {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@font-face

@font-face {
    font-family: "My Font";
    font-weight: 400;
    font-style: normal;
    src: url("../fonts/myfont.woff2") format("woff2"),
         url("../fonts/myfont.woff") format("woff");
}