css – Mostrar imagen por defecto laravel

estoy trabajando con imagenes, en una vista obtengo la imagen relacionada a un producto (almacenada en el storage), la coloco como background en un div Y ME FUNCIONA BIEN pero debo mostrar una imagen por defecto si es que el producto seleccionado no tiene imagen asociada, y en efecto tambien me funciona pero no toma el background (por lo que veo no estoy escapando bien los caracteres)

introducir la descripción de la imagen aquí

Este es el codigo que estoy usando, pero no me doy cuenta donde estoy escapando mal los caracteres:

<div id="tst" style="background-image: url(

          @if($post->image){{ asset('storage/'.$post->image->url_imagen)}} @else
               <img src="https://mdbootstrap.com/img/Photos/Others/images/48.jpg" class="img-fluid" alt="">
                            <div class="mask rgba-white-slight"></div>

                            <img src="https://mdbootstrap.com/img/Photos/Others/images/48.jpg" class="img-fluid">
          @endif")>

block editor – How can I replicate Additional CSS Classes, using a custom control?

I’d like to add a sidebar option to all blocks. When the user selects it, it should add a class to the block props in real-time in the same way that Additional CSS Classes does. Is this possible?

I’ve followed the instructions here and used the blocks.registerBlockType filter to add attributes to all the blocks. And I’ve used editor.BlockEdit to add controls to all the blocks. So it all appears in the sidebar fine. But when I tried blocks.getSaveContent.extraProps it doesn’t work on blocks that use a render_callback (also people seem not to like it in general).

Is there a way?

Help with child theme enqueuing additional css files

A few years back, I made some css and template changes directly in my parent theme, because WordPress was new to me and that seemed easier than messing around with this child theme stuff. It worked fine and I only had to redo it once when the theme updated. Fortunately I had kept records of my changes. Now I have more changes to do and decided to learn how to do it the right way. So far I can’t even get my child theme working the same as things have been, though. My child alterations to the main style.css seem to be working fine, however there are several other parent theme css files in a /css folder, and the child theme seems to be ignoring them no matter what I do.

Here’s the relevant portion of the parent functions.php:

function custom_admin_enqueue() {
    wp_enqueue_script('admincustom', get_template_directory_uri() . '/js/admincustom.js');
    wp_register_style('seometa_wp_admin_css', get_template_directory_uri() . '/css/seometa.css');
    wp_enqueue_style('seometa_wp_admin_css');
}
add_action('admin_enqueue_scripts', 'custom_admin_enqueue');
function lbt_theme_styles() {
    wp_register_style('stylehover', get_template_directory_uri() . '/css/style.css');
    wp_register_style('fontawesome', get_template_directory_uri() . '/css/font-awesome.css');
    wp_register_style('flexslider', get_template_directory_uri() . '/css/flexslider.css');
    wp_register_style('styleisotop', get_template_directory_uri() . '/css/styleisotop.css');
    wp_register_style('slicknav', get_template_directory_uri() . '/css/slicknav.css');
    wp_register_style('styleslide', get_template_directory_uri() . '/css/style-slide.css');
    wp_register_style('jqueryfancybox', get_template_directory_uri() . '/css/jquery.fancybox.css');
    wp_register_style('300', get_template_directory_uri() . '/css/300.css');
    wp_register_style('440', get_template_directory_uri() . '/css/440.css');
    wp_register_style('740', get_template_directory_uri() . '/css/740.css');
    wp_register_style('960', get_template_directory_uri() . '/css/960.css');
    wp_register_style('nivoslider', get_template_directory_uri() . '/css/nivo-slider.css');
    // Styles
    wp_enqueue_style('stylehover');
    wp_enqueue_style('fontawesome');
    wp_enqueue_style('flexslider');
    wp_enqueue_style('styleisotop');
    wp_enqueue_style('slicknav');
    wp_enqueue_style('styleslide');
    wp_enqueue_style('jqueryfancybox');
    wp_enqueue_style('300');
    wp_enqueue_style('440');
    wp_enqueue_style('740');
    wp_enqueue_style('960');
    wp_enqueue_style('nivoslider');
}

The key files here are the 300, 440, 740, and 960. Those are the ones I can tell immediately aren’t being loaded (they control how the layout shifts for narrower screens), and also except for 960 the only ones I need to make changes/additions to.

After many iterations of things that didn’t work, I’ve arrived at this code, which also doesn’t work, but continued searching though tutorials and old help forum posts aren’t getting me any further than this:

  add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles',999 );
  function theme_enqueue_styles() {
     wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
     wp_enqueue_style( 'stylehover', get_template_directory_uri() . '/css/style.css' );
     wp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/css/font-awesome.css' );
     wp_enqueue_style( 'flexslider', get_template_directory_uri() . '/css/flexslider.css' );
     wp_enqueue_style( 'styleisotop', get_template_directory_uri() . '/css/styleisotop.css' );
     wp_enqueue_style( 'slicknav', get_template_directory_uri() . '/css/slicknav.css' );
     wp_enqueue_style( 'styleslide', get_template_directory_uri() . '/css/style-slide.css' );
     wp_enqueue_style( 'jqueryfancybox', get_template_directory_uri() . '/css/jquery.fancybox.css' );
     wp_enqueue_style( '300', get_template_directory_uri() . '/css/300.css' );
     wp_enqueue_style( '440', get_template_directory_uri() . '/css/440.css' );
     wp_enqueue_style( '740', get_template_directory_uri() . '/css/740.css' );
     wp_enqueue_style( '960', get_template_directory_uri() . '/css/960.css' );
     wp_enqueue_style( 'nivoslider', get_template_directory_uri() . '/css/nivo-slider.css' );
     wp_enqueue_style( 'seometa_wp_admin_css', get_template_directory_uri() . '/css/seometa.css' );
     
     wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'parent-style' ) );
     wp_enqueue_style( '300', get_stylesheet_directory_uri() . '/300.css', array( '300' ) );
     wp_enqueue_style( '440', get_stylesheet_directory_uri() . '/440.css', array( '440' ) );
     wp_enqueue_style( '740', get_stylesheet_directory_uri() . '/740.css', array( '740' ) );
}

What’s the trick that I’m missing? Thank you!

spfx – Is it possible to apply custom CSS to the SharePoint Online Site Content page?

Yes, you can add custom CSS or JS to modern pages using SPFx Application customizer.

For more information, check my answer at: What is the best practice for getting JS and CSS files into a SharePoint Modern Page?


Note: DOM manipulation & CSS customizations are not recommended by Microsoft and some of your customization may break if Microsoft changes HTML element id/classes in new release updates.

css – Can you force text to not display if font is not loaded?

I am using a custom font to display some text at the beginning of my blog post. What I desire, is for the text to display only if the font has been installed by the user. Here is my first attempt:

<h4>An interesting numbering system<span style="font-family: 'Tolvtalsystem';
font-display: block">: &#x2474; &#x2475; &#x2476; &#x2477; &#x2478; &#x2479;
&#x247a; &#x247b; &#x247c; &#x247d; &#x247e; &#x247f;</span></h4>

However, reading closer on how font-display works, it appears to be that all the options always fall back to a default font; the various settings only instruct the browser on how long it takes and how it performs the check. Therefore, is there a way to use font-display (or some other CSS-trick) so that whatever is within the tag is displayed only if the font successfully loads?

Here is an image displaying the desired result:
Image displaying desired outputs using CSS property font-display.

html – CSS Calcular padding baseado no padding superior

Estou tentando fazer um menu aside com ul e a minha ideia é fazer uma árvore onde cada novo ul dentro de um li ser acrescido um padding-left para que cada novo submenu (ul) adicionado tenha um espaço extra identificando de forma fácil a hierarquia destes submenus.

Isto pode ser facilmente resolvido adicionado um padding-left a ul, cada novo ul estará espaçado um pouco a mais da margem devido ao acumulo de padding-left.

O Problema desta abordagem é que o :hover não ficará até a borda já que todos os elementos terão sofrido um padding-left juntos.

Particularmente sempre que preciso configurar medidas e paddins faço diretamente no link a para que este problema de :hover não ocorra, no entanto não descobri uma forma de fazer um padding-left acumulativo no link.

aside {
  width: 300px;
  height: 700px;
  position: static;
  left: 0;
  background-color: #292d39;
}

aside ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
aside ul a {
  display: block;
  padding: 10px 0px;
  text-decoration: none;
  color: #fff;
}
aside ul a:hover {
  background-color: #007acc;
}
aside ul{
  padding-left: 15px;
}
<aside>
  <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">Menu 1</a>
      <ul>
        <li><a href="#">&lt;Afastado: Sub 1.1</a></li>
        <li><a href="#">Sub 1.2</a></li>
        <li><a href="#">Sub 1.3</a>
          <ul>
            <li><a href="#">&lt;Hover não fica no canto: Sub 2.1</a></li>
            <li><a href="#">Sub 2.2</a></li>
            <li><a href="#">Sub 2.3</a></li>
          </ul>
        </li>
      </ul>
    </li>
    <li><a href="#">Menu 2</a></li>
  </ul>
</aside>

Aqui em baixo uma versão com padding-left aplicado diretamente ao link <a>. Muito melhor pois o :hover irá atuar até mesmo no canto esquerdo pois o padding-left está afastando o conteúdo do link e não mais o link da lateral esquerda.

aside {
  width: 300px;
  height: 700px;
  position: static;
  left: 0;
  background-color: #292d39;
}
aside ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
aside ul a {
  display: block;
  padding: 10px 15px;
  text-decoration: none;
  color: #fff;
}
aside ul a:hover {
  background-color: #007acc;
}
/*Funciona mas tem que ficar repetindo este código acrescentando mais espaço*/
aside ul ul a{
  padding-left: 30px;
}
aside ul ul ul a{
  padding-left: 45px;
}
<aside>
  <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">Menu 1</a>
      <ul>
        <li><a href="#">Sub 1.1</a></li>
        <li><a href="#">Sub 1.2</a></li>
        <li><a href="#">Sub 1.3</a>
          <ul>
            <li><a href="#">Sub 2.1</a></li>
            <li><a href="#">Sub 2.2</a></li>
            <li><a href="#">Sub 2.3</a>
<ul>
            <li><a href="#">Sub 3.1 (não vai pois tem que repetir o css)</a></li>
            <li><a href="#">Sub 3.2</a></li>
            <li><a href="#">Sub 3.3</a></li>
          </ul>
</li>
          </ul>
        </li>
      </ul>
    </li>
    <li><a href="#">Menu 2</a></li>
  </ul>
</aside>

Alguém tem alguma dica ou a solução é apelar para o JS?

javascript – Custom CSS AND JS Plugin not working with js code

I have a JS script which loads chatbot User interface. the scripts works everywhere on the internet except in WordPress. I have tried several other plugins but the issue is same…

<script>
    var str = window.location.href;

    var params={};

    window.location.search

    .replace(/(?&)+((^=&)+)=((^&)*)/gi, function(str,key,value) {

      params(key) = value;

    });

    window.CCHAT_CONFIG = {

      EMBED_TOKEN: typeof(params.token) !== "undefined" && params.token !== null ? params.token : "f0a3dc1f865a4b349a11b78282c2ab0f",

      HOST_URL: "http://18.116.204.111/"

    };

    (function() {

      window.business_name = 'Welcome to DentalChat!';

      window.business_ID = '153';

      window.widgetTimeout = 1;
      window.NAME = "DentalChat"


      var scriptTag = document.createElement('script');

      scriptTag.type = 'text/javascript';

      scriptTag.async = true;

      scriptTag.src = window.CCHAT_CONFIG.HOST_URL + 'loader.js?t='+Math.random();

      var s = document.getElementsByTagName('script')(0);

      s.parentNode.insertBefore(scriptTag, s);

    })();
  </script>

I will create Fully Responsive Website using HTML, CSS, Bootstrap for $15

I will create Fully Responsive Website using HTML, CSS, Bootstrap

Hello everyone!

Are you looking to create attractive webpages?

If you are looking for an HTML, CSS, Bootstrap developer for your professional website, Well here I am!.

I am a Full stack Software Engineer (UG)

I will create fully responsive web page or a website as you wish

WHY CHOOSE ME?

  • 100% Satisfaction
  • Unlimited Revisions
  • Delivery On-Time

Please also contact me for any projects.

NOTE: Message me first before placing the order.

.(tagsToTranslate)website(t)design(t)html(t)css(t)responsive(t)bootstrap

Missing “Additional CSS” option in Customizer

Since upgrading to WordPress 5.7, the “Additional CSS” option seems to be missing in Customizer at Appearance -> Customize on various WordPress websites I look after with various different themes including Astra and GeneratePress.

I have updated the plugins and themes to the latest versions but this has not helped.

I realise I can add custom CSS via a plugin and possibly via a child theme but what happened to this option?