Site logo

[Resolved] Custom Paragraph Block with CSS and HTML

Home Forums Support [Resolved] Custom Paragraph Block with CSS and HTML

Home Forums Support Custom Paragraph Block with CSS and HTML

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2515011
    jal-mj

    Hello,

    I want to customize a paragraph block.

    Usually, I would apply the CSS class on the ADDITIONAL CSS CLASS(ES) (advanced area), and that’s all, but the problem is that I need some HTML code.

    This is what I want to do:

    https://ibb.co/NCczhLq

    So by now, to do so, I have done the HTML in the HTML block post and the CSS on an element page. But this is not good. I want to create a block template where I can insert it while doing the post and writing the paragraph.

    It would be good too if I could apply CSS classes where the CSS and the HTML apply, but actually, I don’t know if that is possible.

    Thank you for your time.

    #2515070
    Fernando
    Customer Support

    Hi Jal-mj,

    You can do such a structure with GenerateBlocks plugin.

    You just need to place the Featured text and the inner text through 2 different Headline Blocks, and place both on one Container Block.

    Then add Borders to the Container Block.

    Lastly, give the Featured text a negative top margin. If this doesn’t work, we can use custom CSS to position it.

    #2515080
    jal-mj

    Hello Fernando,

    Could you be more specific?

    I already have generate blocks plugin, but I don’t know how to apply this design in a block.

    Could you be more specific in the process? Thank you.

    #2515083
    Fernando
    Customer Support

    Can you create a structure like this?: https://share.getcloudapp.com/bLuO2eYy

    Afterward, provide the link to where we can see this, and I’ll check what CSS is needed.

    #2515091
    jal-mj

    You can find the URL in the private area.

    It is at the bottom of the page. I have created the blocks with no problems, but they are not working correctly on different devices. Please check the size of the screen to see what I mean.

    https://ibb.co/TqVMYSb

    Under the block, there is the HTML code that I did before. That is the way that I want to work.

    So maybe some css code is needed….

    Thank you.

    #2515108
    Fernando
    Customer Support

    Here’s a CSS you can try:

    .gb-container.gb-container-ba10bc52 > .gb-inside-container {
        position: relative;
    }
    
    .gb-container.gb-container-ba10bc52 > .gb-inside-container .featured-word{
        position: absolute;
        top:-20px;
        left: 16px;
        padding: 0 6px;
    }

    This CSS positions the Featured word similar to your HTML Block.

    #2515148
    jal-mj

    Perfect Fernando, it works fine!

    If I want to do more I have to change the .gb-container-ba10bc52 <– container number in CSS, isn’t it?

    Thank you.

    #2515151
    Fernando
    Customer Support

    Are you referring to changing stuff like the padding? If so, you can change that in the Block settings.

    You can replace this with a Custom class as well: gb-container-ba10bc52

    Adding Custom Classes: https://wordpress.com/support/wordpress-editor/adding-additional-css-classes-to-blocks/

    #2515158
    jal-mj

    All is clear Fernando. Thank you for all.

    #2515163
    Fernando
    Customer Support

    You’re welcome, Jal-mj!

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