Skip to content

Widget | CSS customization

Solved WordPress
53 2 9.1k 1
  • @Sala said in Widget | CSS customization:

    In additional css, iโ€™ve iframe { width 100% and height 315 but without important. If i add important, it affects the height of the ads

    It will do, yes, because you have this CSS present

    div.text img {
        width: 100%;
        height: 315px;
    }
    

    Youโ€™d need to be more specific here in terms of CSS target. The below would work

    .perfmatters-lazy-youtube img {
        height: 500px !important;
    }
    

    @phenomlab it was hidden in the outskirts ๐Ÿ˜ฉ โ€ฆ Thanks for opening my eyes.

  • @phenomlab it was hidden in the outskirts ๐Ÿ˜ฉ โ€ฆ Thanks for opening my eyes.

    @Sala no problems!

  • @Sala no problems!

    @phenomlab Sometimes you donโ€™t remember to ask questions until you actually see them. Like onto every page I created, there is a space between the images that I would like to remove using CSS. It was built with a code that looks like this:

    <!-- wp:media-text {"align":"wide","mediaId":673,"mediaLink":"https://wordpress.org/patterns/pear-half/","mediaType":"image","verticalAlignment":"center","style":{"color":{"background":"#BE035C"}}} -->
    <div class="wp-block-media-text alignwide is-stacked-on-mobile is-vertically-aligned-center has-background" style="background-color:#BE035C"><figure class="wp-block-media-text__media"><img src="/wp-content/uploads/2023/01/sign-in.jpg" alt="Account" class="wp-image-673 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:group {"style":{"spacing":{"padding":{"top":"2em","right":"2em","bottom":"2em","left":"2em"}}}} -->
    <div class="wp-block-group" style="padding-top:2em;padding-right:2em;padding-bottom:2em;padding-left:2em"><!-- wp:html -->
    <p class="has-text-align-center" style="font-size:20px;line-height:1.3"><p class="has-text-align-center" style="font-size:20px;color:#ffffff;line-height:1.2">Bring your .. to fruition!</p></p>
    <!-- /wp:html --></div>
    <!-- /wp:group --></div></div>
    <!-- /wp:media-text -->
    

    Space
    alt text

  • @phenomlab Sometimes you donโ€™t remember to ask questions until you actually see them. Like onto every page I created, there is a space between the images that I would like to remove using CSS. It was built with a code that looks like this:

    <!-- wp:media-text {"align":"wide","mediaId":673,"mediaLink":"https://wordpress.org/patterns/pear-half/","mediaType":"image","verticalAlignment":"center","style":{"color":{"background":"#BE035C"}}} -->
    <div class="wp-block-media-text alignwide is-stacked-on-mobile is-vertically-aligned-center has-background" style="background-color:#BE035C"><figure class="wp-block-media-text__media"><img src="/wp-content/uploads/2023/01/sign-in.jpg" alt="Account" class="wp-image-673 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:group {"style":{"spacing":{"padding":{"top":"2em","right":"2em","bottom":"2em","left":"2em"}}}} -->
    <div class="wp-block-group" style="padding-top:2em;padding-right:2em;padding-bottom:2em;padding-left:2em"><!-- wp:html -->
    <p class="has-text-align-center" style="font-size:20px;line-height:1.3"><p class="has-text-align-center" style="font-size:20px;color:#ffffff;line-height:1.2">Bring your .. to fruition!</p></p>
    <!-- /wp:html --></div>
    <!-- /wp:group --></div></div>
    <!-- /wp:media-text -->
    

    Space
    alt text

    @Sala let me have a look. That theme is using inline styling which is bad practice and means youโ€™d have to force override with

     !important
    
  • @Sala let me have a look. That theme is using inline styling which is bad practice and means youโ€™d have to force override with

     !important
    

    @phenomlab Actually, I was the one who made it utilize inline CSS because I believed it would be a simpler method to lessen the load of http requests.

  • @phenomlab Actually, I was the one who made it utilize inline CSS because I believed it would be a simpler method to lessen the load of http requests.

    @Sala ah, OK. That wouldnโ€™t have any impact on the http requests as such as its only text that is being requested. The best way to optimise in that case is to minify the css.

  • @phenomlab Sometimes you donโ€™t remember to ask questions until you actually see them. Like onto every page I created, there is a space between the images that I would like to remove using CSS. It was built with a code that looks like this:

    <!-- wp:media-text {"align":"wide","mediaId":673,"mediaLink":"https://wordpress.org/patterns/pear-half/","mediaType":"image","verticalAlignment":"center","style":{"color":{"background":"#BE035C"}}} -->
    <div class="wp-block-media-text alignwide is-stacked-on-mobile is-vertically-aligned-center has-background" style="background-color:#BE035C"><figure class="wp-block-media-text__media"><img src="/wp-content/uploads/2023/01/sign-in.jpg" alt="Account" class="wp-image-673 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:group {"style":{"spacing":{"padding":{"top":"2em","right":"2em","bottom":"2em","left":"2em"}}}} -->
    <div class="wp-block-group" style="padding-top:2em;padding-right:2em;padding-bottom:2em;padding-left:2em"><!-- wp:html -->
    <p class="has-text-align-center" style="font-size:20px;line-height:1.3"><p class="has-text-align-center" style="font-size:20px;color:#ffffff;line-height:1.2">Bring your .. to fruition!</p></p>
    <!-- /wp:html --></div>
    <!-- /wp:group --></div></div>
    <!-- /wp:media-text -->
    

    Space
    alt text

    @Sala That is in the below class

    #single .main-article {
        position: relative;
        z-index: 1;
        background: #fff;
        padding: 50px 60px;
        -webkit-box-shadow: 0 3px 12px -1px rgba(7,10,25,.1), 0 22px 27px -30px rgba(7,10,25,.1);
        box-shadow: 0 3px 12px -1px rgba(7,10,25,.1), 0 22px 27px -30px rgba(7,10,25,.1);
    }
    

    You should experiment with the padding: 50px 60px; to get the spacing you need.

    Changing to padding: 0px 60px; ought to do it ๐Ÿ™‚

    Before

    5abc844c-40ed-43f1-a38d-ba8fc0267b51-image.png

    After

    8fede2b1-772e-4215-908f-6954603b528f-image.png

  • @Sala That is in the below class

    #single .main-article {
        position: relative;
        z-index: 1;
        background: #fff;
        padding: 50px 60px;
        -webkit-box-shadow: 0 3px 12px -1px rgba(7,10,25,.1), 0 22px 27px -30px rgba(7,10,25,.1);
        box-shadow: 0 3px 12px -1px rgba(7,10,25,.1), 0 22px 27px -30px rgba(7,10,25,.1);
    }
    

    You should experiment with the padding: 50px 60px; to get the spacing you need.

    Changing to padding: 0px 60px; ought to do it ๐Ÿ™‚

    Before

    5abc844c-40ed-43f1-a38d-ba8fc0267b51-image.png

    After

    8fede2b1-772e-4215-908f-6954603b528f-image.png

    @phenomlab i tried with 0; and 60; padding, it works fine on desktop but not on mobile version. Somehow on the content on mobile are also squeezed at the center,

    alt text

    Probably @media can be a good thought

  • @phenomlab i tried with 0; and 60; padding, it works fine on desktop but not on mobile version. Somehow on the content on mobile are also squeezed at the center,

    alt text

    Probably @media can be a good thought

    @Sala Yes, try

    @media screen and (max-width: 767px) {
    #single .main-article {
        padding: 0px 20px 20px 20px;
       }
    }
    

    Result

    cd83ac24-40aa-45de-ad62-ff27ba6fb640-image.png

  • @Sala Yes, try

    @media screen and (max-width: 767px) {
    #single .main-article {
        padding: 0px 20px 20px 20px;
       }
    }
    

    Result

    cd83ac24-40aa-45de-ad62-ff27ba6fb640-image.png

    @phenomlab itโ€™s applied

  • @phenomlab itโ€™s applied

    @Sala Working? From what I see, it is ๐Ÿ™‚

  • @Sala Working? From what I see, it is ๐Ÿ™‚

    @phenomlab I was expecting you would need my login information for this one, but you solved it without needing to log in! Congratulations! Another thing is that the website appeared to have been zoomed in when I viewed it once using a friendโ€™s laptop, which I believe had a 14 or 15-inch screen. Do you experience this similar problem? Is it possible to make it that you can see a lot when you visit? Just like many forums

    โ€œLate reply, my phone became really hot when applying that cssโ€ ๐Ÿฅต

  • @Sala Working? From what I see, it is ๐Ÿ™‚

    Sometime back, it handled huge traffic without lag, wordpress is just superb!
    alt text

  • Sometime back, it handled huge traffic without lag, wordpress is just superb!
    alt text

    @Sala impressive!

  • @phenomlab I was expecting you would need my login information for this one, but you solved it without needing to log in! Congratulations! Another thing is that the website appeared to have been zoomed in when I viewed it once using a friendโ€™s laptop, which I believe had a 14 or 15-inch screen. Do you experience this similar problem? Is it possible to make it that you can see a lot when you visit? Just like many forums

    โ€œLate reply, my phone became really hot when applying that cssโ€ ๐Ÿฅต

    @Sala hmm - are you sure that your friend isnโ€™t using zoom at the browser level? Thereโ€™s nothing that would make your site zoom by default. Your friend may also be using large fonts which can make sites already to look larger than they actually are.

  • @Sala hmm - are you sure that your friend isnโ€™t using zoom at the browser level? Thereโ€™s nothing that would make your site zoom by default. Your friend may also be using large fonts which can make sites already to look larger than they actually are.

    @phenomlab i suspect the ads inside the content in articles , are not benefiting from full width of the article div container, probably theyโ€™re in some other container? Bcoz all the time (on mobile) theyโ€™re positioned at center and with a small width

  • I will inspect next time, and take some screenshots of the zoom issue.

  • @phenomlab i suspect the ads inside the content in articles , are not benefiting from full width of the article div container, probably theyโ€™re in some other container? Bcoz all the time (on mobile) theyโ€™re positioned at center and with a small width

    @Sala said in Widget | CSS customization:

    probably theyโ€™re in some other container?

    Yes, likely.

  • @Sala said in Widget | CSS customization:

    probably theyโ€™re in some other container?

    Yes, likely.

    @phenomlab we break that container, when some time ever comes. Full width has potential of increasing chance of click, tho could sound annoying, i know

  • @Sala said in Widget | CSS customization:

    In additional css, iโ€™ve iframe { width 100% and height 315 but without important. If i add important, it affects the height of the ads

    It will do, yes, because you have this CSS present

    div.text img {
        width: 100%;
        height: 315px;
    }
    

    Youโ€™d need to be more specific here in terms of CSS target. The below would work

    .perfmatters-lazy-youtube img {
        height: 500px !important;
    }
    

    @phenomlab it appears this css didnโ€™t take effect, despite using ! important. If you able to see the path, i could change it from cpanel. Google reported the same issue today.

    .perfmatters-lazy-youtube img{height:315px!important}
    

    Page example: view-source:https://sopriza.com/how-kenya-can-use-films-to-attract-more-tourists/


Did this solution help you?
Did you find the suggested solution useful? Support ๐Ÿ’— Sudonix with a coffee โ˜•
If your organisation needs deeper expertise around infrastructure, security, or technology leadership, learn more about Phenomlab Ltd. Many of the deeper technical guides behind Sudonix are published there.

Related Topics
  • navigation menu panel on mobile

    Solved Customisation nodebb css
    8
    1
    7 Votes
    8 Posts
    1k Views
    @crazycells hmm. Thatโ€™s odd. I havenโ€™t made any changes from recollection but I could be wrong. Iโ€™ll need to check. EDIT - very strange. I honestly donโ€™t recall adding the below CSS block to alter the bottom bar, but youโ€™re rightโ€ฆ .bottombar-nav { padding: 0px !important; } Iโ€™ve removed this so it reflects stock Harmony.
  • Fixing YouTube videos css

    Solved WordPress css
    8
    2 Votes
    8 Posts
    1k Views
    @phenomlab It looks good, but not anymore. Iโ€™ve already lost so much time. Now itโ€™s time to move on
  • The best css to customize our logo?

    Solved Customisation css
    2
    1 Votes
    2 Posts
    1k Views
    @Sala This should look better .sidenav .navbar-brand { padding-top: 0.5rem; padding-bottom: 0.5rem; } [image: 1669026666905-e5cec20e-be36-4ee8-9129-fd11ad4656ac-image.png] You can increase the top and bottom padding by increasing the values above.
  • answers appearance css code request

    Solved Customisation css answers
    11
    1
    1 Votes
    11 Posts
    2k Views
    @DownPW yes, because of the modifications that Sudonix uses, youโ€™ll need to tailor to fit your needs.
  • Blinking text Effect

    Customisation nodebb text effect css
    3
    5 Votes
    3 Posts
    953 Views
    @phenomlab I love it too @phenomlab said in Blinking text Effect: Has that โ€œbroken neon lightโ€ look that you see in films. Itโ€™s exactly that, kind of old neon signs of bar or pubs a bit cyberpunk too
  • [NODEBB] Reply Button/arrow answer

    Solved Customisation css nodebb
    25
    4
    4 Votes
    25 Posts
    6k Views
    Topic open https://sudonix.com/topic/207/nodebb-help-for-my-custom-css
  • [NODEBB] Scroll Button

    Solved Customisation css javascript html scroll button
    7
    1
    0 Votes
    7 Posts
    2k Views
    @downpw ooops. Forgot that. Thanks for adding.
  • Avatar on Topic Header

    Solved Customisation css avatar header
    9
    1
    0 Votes
    9 Posts
    2k Views
    @jac said in Avatar on Topic Header: @downpw said in Avatar on Topic Header: Great Plugin I make it a bit cleaner via this CSS code: /*------------------------------------------------------------------*/ /*---------------- nodebb-plugin-browsing-users -----------------*/ /*------------------------------------------------------------------*/ /*Space between the avatar and the RSS icon */ .topic [component="topic/browsing-users"] { margin-bottom: -5px; padding-left: 10px; } /*Space between avatars*/ .pull-left { float: left!important; padding-right: 5px; } Do you have a screenshot of how this looks with the CSS change? Just added this change, thanks @DownPW