Can these Bootstrap blockquote styles be improved?

I’m now working with Bootstrap, so I’m updating my style sheets accordingly. I have one particular style that works beautifully, but the styles that make it work look amateurish at best.

You can see a working example @ http://jsfiddle.net/dzsazos1/2/ However, it looks much better than that when linked to Bootstrap’s style sheet.

Ideally, I’d like to simplify the HTML as much as possible. It would be nice if I could just give a blockquote one of two classes - PoliQuoteL or PoliQuoteR - and it would be automatically styled and floated to the left or right.

I should not that the class PoliQuote in these examples does nothing. I just retained that class for further styling to distinguish these from regular blockquotes.

Anyway, can you see a way to improve my styles?

Thanks.

HTML…

<blockquote class="PoliQuote pull-left"><span class="Quote">&#8220;</span>The measure of a man is what he does with power.<span class="Quote">&#8221;</span>
      <footer>Plato</footer>
    </blockquote>

<blockquote class="PoliQuote blockquote-reverse half"><span class="Quote">&#8220;</span>Ideas are more powerful than guns. We would not let our enemies have guns, why should we let them have ideas?<span class="Quote">&#8221;</span>
      <footer><a href="/people/joseph-stalin" title="Joseph Stalin">Joseph Stalin</a></footer>
    </blockquote>

CSS Styles…

blockquote { margin-bottom: 10px; font-family: Georgia, Arial, sans-serif; color: #888; }
blockquote .Quote { color: #009; }
blockquote footer { font-family: Arial, Verdana, sans-serif; }
blockquote.pull-left, .blockquote-reverse.half { width: 50%; max-width: 300px; padding-left: 0; padding-bottom: 0; margin-bottom: 0; }
blockquote.pull-left { margin-right: 15px; padding-left: 15px; }
.blockquote-reverse.half { float: right; margin-left: 15px; }
blockquote.pull-left .Quote { display: block; font-size: 700%; margin-top: -40px; margin-bottom: -100px; }
blockquote footer { position: relative; z-index: 1; }
blockquote.pull-left footer { margin-left: 5px; }
.blockquote-reverse footer { margin-right: 5px; }
.blockquote-reverse .Quote { display: block; font-size: 700%; margin-top: -40px; margin-bottom: -100px; }

Those spans you use as quotes could be on the before/after pseudo elements with the “quotes” propeorty. Your jsfiddle looks really awkward and incomplete. Do you have a live website? I doubt very much that the jsfiddle looks like what hte live website looks like.

It’s difficult to gauge how well these styles are without a live environment.

Sorry, I don’t have a live website yet. The styes actually work beautifully; like I said, it looks far better when connected to Bootstrap’s style sheet.

I just wondered if I could accomplish the same thing with more elegant, streamlined styles. I’m not sure what you mean by putting the quote spans on the before/after pseudo elements. Could you show me an example?

Thanks.

2 Likes

Cool, I’ll give that a try. I’m not sure if it will work on quotes floated to the right, though.

If you visit http://www.theguardian.com/commentisfree/2015/feb/01/putin-stopped-ukraine-military-support-russian-propaganda and scroll about a third of the way down the page, you’ll see a quote in the left margin wrapped in orange quotation marks. That’s the style I’m shooting for.

Actually, my blockquotes already look like that; it’s just that the styles are so awkward. On another note, I just discovered that The Guardian’s quote is variously inline or completely outside the article, depending on one’s screen size. That’s kind of cool, too. :wink:

The link you posted is probably better for regular blockquotes - quotes that aren’t floated. So I am going to check it out, because I’ll be using those kinds of quotes as well.

Hi Chavista,

I’ve put a small demo together for you. The result is not the same but quite close to the blockquote example in the website you indicated in your earlier post. I used the starter template from Bootstrap (just to have a base) and a bit of the CSS-trick code that Ryan pointed out above, although adapted to your idea. The blockquote is positioned outside the content in wider screens, floated to the left in smaller screens, and not floated and embedded in the main text on very small screens. The upside is that the code is quite lean and you don’t see any spans.

3 Likes

That’s very cool; thanks.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.