Support » Theme: Twenty Nineteen » Styling the blockquote

  • I notice that the CSS for the blockquote appears to run inline in the HTML, not in the stylesheet.

    <blockquote class="wp-block-quote font-size: 30px; background: #f9f9f9; border-left: 10px solid #ccc; margin: .5em 10px; padding: 0 quotes: &quot;\201C&quot;&quot;\201D&quot;&quot;\2018&quot;&quot;\2019&quot;; 20px; line-height: 1.4;"><p> text here </p></blockquote>

    Have I got that right?

    If so, how can I do I change this code? I’d prefer to keep all my CSS in a stylesheet, can I do that?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Are you using some type of editor like Elementor or similar when trying to add the blockquote?

    When using Gutenberg (new editor) I get this for a blockquote block

    <blockquote class="wp-block-quote"><p>Gutenberg blockquote</p><cite>Citation</cite></blockquote>

    It doesn’t contain any of the extra code you mentioned though. Additionally, your code isn’t defined correctly. For inline CSS it should look like this

    <blockquote class="Wp-block-quote" style="font-size: 30px; background: #f9f9f9; border-left: 10px solid #ccc; margin: .5em 10px; padding: 0"><p>text here</p></blockquote>

    No editor. I just want to change the CSS but that means overriding the in-line CSS which looks tricky.

    The code I quoted was cut and pasted directly out of the HTML.

    Moderator Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Cut from Microsoft Word? Try using Notepad instead because some software contain inline styles that should not be there.

    No, cut and pasted direct from my site’s HTML.

    Where are you finding your site’s html? As Jarrett suggested, the markup of the blockquote seems to be wrong. How is it being gererated on the site? Are you putting it in as text via Gutenberg or using a block in Gutenberg?

    It looks like the problem is in the manner of generating the <blockquote … code.

    It should look like the markup Jarrett quoted — with a class=”wp-block-quote” and a style=”….” with all of your overrides.

    I would suggest going to the Appearance>Custome>CSS and creating the markup you need there and only there, using your example.

    .wp-block-quote
    {
    ont-size: 30px; 
    background: #f9f9f9; 
    border-left: 
    10px solid #ccc; 
    margin: .5em 10px; 
    padding: 0 quotes: &quot;\201C&quot;&quot;\201D&quot;&quot;\2018&quot;&quot;\2019&quot;; 20px; 
    line-height: 1.4;
    }

    I load the page in the browser. I’m using Safari. I can either look at the page as HTML or use the “inspect element” option to go direct to any item. When I see the HTML, I selected it, cut it and posted it into the edit box at the top of this page.

    My question isn’t about the extra characters that appear in that quote. That’s just something odd that happens when posting the code into the edit box. I want to know how I can change the inline css. Do I need to edit a function or can I do this in the css style sheet?

    Yes, you should be doing something with the Appearance option, either editing the stylesheet or customizing.

    How this inline code is being added is the question. You need to look at how you are adding blockquotes. There seems to be something wrong with it as Jarret pointed out.

    I’m using the straight Gutenberg blockquote option. Nothing else. It’s marked as quote in the list of Getenberg blocks.

    That code is either coming from the theme or it’s hardcoded into WordPress.

    So I either need to identify if the hardcoded inline CSS is in the functions or in WordPress or perhaps it comes from somewhere else in the theme files.

    I feel that my question is going around in circles here.

    Moderator Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Your question is how to change the inline styling? This is our answer:
    1) Don’t change the inline styling;
    2) Figure out where the inline styling is being added and how;
    3) Remove the inline styling;
    4) Use the appropriate method of adding CSS via the “Additional CSS” part of the dashboard or through a Child Theme style.css file.

    However you’re right we’re going in circles because you’ve yet to tackle step 2.

    Moderator Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    This may be a plugin or theme conflict. Please attempt to disable all plugins, and use one of the other default (Twenty*) themes. If the problem goes away, enable them one by one to identify the source of your troubles.

    If you can install plugins, install “Health Check”: https://wordpress.org/plugins/health-check/ On the troubleshooting tab, you can click the button to disable all plugins and change the theme for you, while you’re still logged in, without affecting normal visitors to your site. You can then use its admin bar menu to turn on/off plugins and themes one at a time.

    “Your question is how to change the inline styling? This is our answer:
    1) Don’t change the inline styling;
    2) Figure out where the inline styling is being added and how;
    3) Remove the inline styling;
    4) Use the appropriate method of adding CSS via the “Additional CSS” part of the dashboard or through a Child Theme style.css file.

    However you’re right we’re going in circles because you’ve yet to tackle step 2.”

    Are saying that this isn’t standard. That other people don’t see the blockquote inline CSS?

    It’s not there if I change the theme. So it could be part of the theme.

    The theme-plug-in conflict idea is also plausible. I’ll work through that later.

    Could it also be to do with how the Gutenberg quote block is configured?

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.