mhulse / css-issues

Practical CSS code snippets and examples.
11 stars 1 forks source link

Blockquotes using FontAwesome #152

Open mhulse opened 6 years ago

mhulse commented 6 years ago

Using FontAwesome v4:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/fontawesome/4.7.0/css/font-awesome.min.css">

???

Need screen shot.

blockquote::before,
blockquote::after {
    font-family: FontAwesome;
    font-style: normal;
    font-weight: normal;
    font-size: 6rem;
    color: rgba(0, 0, 0, .1);
    line-height: 1;
    position: absolute;
}
blockquote::before {
    top: -2.5rem; /*  Half `blockquote` vertical margin. */
    left: -4rem; /* Same as the `blockquote` horizontal margin. */
    content: "\f10d";
}
blockquote::after { content: "\f10e"; }

??

Need screen shot.

Existing BQ needs top/left for position:


/* Quote: */
blockquote { position: relative; }
blockquote > p { padding-left: 3.5em; }
blockquote::before,
blockquote::after {
    font-family: FontAwesome;
    font-style: normal;
    font-weight: normal;
    font-size: 30px;
    color: rgba(0, 0, 0, .1);
    line-height: 1;
    position: absolute;
    z-index: 2;
}
blockquote::before {
    top: 8px;
    left: 10px;
    content: "\f10d";
}

Pseudo-inline quotes

screenshot 2018-08-01 10 55 30

.pre_ap_quadrant blockquote {
    font-weight: bold;
    color: #2B7CB8;
    font-size: 18px;
    font-style: italic;
    line-height: 22px;
    letter-spacing: .05em;
    word-spacing: .15em;
    margin: 0 0 0 2em;
    padding: 0;
    position: relative
}
.pre_ap_quadrant blockquote + blockquote {
    margin-top: 10px;
}
.pre_ap_quadrant blockquote > :first-child {
    margin-top: 0 !important
}
.pre_ap_quadrant blockquote > :last-child {
    margin-bottom: 0 !important
}
.pre_ap_quadrant blockquote::before,
.pre_ap_quadrant blockquote::after {
    color: #2B7CB8;
    font-family: FontAwesome;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
}
.pre_ap_quadrant blockquote::before {
    position: absolute;
    top: 0.2em;
    left: -1.35em;
    content: "\f10d";
}
.pre_ap_quadrant blockquote::after {
    content: "\f10e";
    position: relative;
    left: 0.25em;
}