WordPress Negative Margins are Awesome!

Поділитися
Вставка
  • Опубліковано 21 жов 2024

КОМЕНТАРІ • 98

  • @dennis_woo
    @dennis_woo 5 місяців тому +4

    Whoah!!!!

  • @MichelleBullochCH
    @MichelleBullochCH 5 місяців тому +2

    Short and to the point: another brilliant video to encourage us all to use the site builder & Gutenberg plugin. Thanks Jamie!

    • @jamiewp
      @jamiewp  5 місяців тому +2

      Thank you Michelle 🙏

  • @yvonned2781
    @yvonned2781 3 місяці тому

    Can't stop loving the cat

    • @jamiewp
      @jamiewp  3 місяці тому +1

      That's what my family say as well 🙃

  • @MysticOblong
    @MysticOblong 4 місяці тому

    Thanks for mentioning this. I've been away from Wordpress for the past six months and am catching up with recent developments before I start updating a client's site. Negative margins will be very handy - this is something I usually achieve with a bit of CSS, so it's nice to have it out of the box now.

  • @jdccool
    @jdccool 4 місяці тому +1

    Yowser! That is VERY COOL.. That's sure gonna make things a tad easier. And explained so well in less than 4 min! Bookmarking this one, TY, Jamie.

  • @AshishBanerjee
    @AshishBanerjee 5 місяців тому +1

    theres something very soothing aand calming about your videos. please never stop making these tutorials :)

    • @jamiewp
      @jamiewp  5 місяців тому

      Thank you, I'm going to tell my family your kind words 😃

  • @tjsayers5428
    @tjsayers5428 5 місяців тому +1

    It’s about time! I use negative margins a lot in my non-Wordpress sites. Looking forward to this. Thanks for sharing!

  • @vertimaron
    @vertimaron 5 місяців тому +4

    To never forget what padding and margin are, use your hand! When you open or close it, that's padding, and if you move it up, down, left, or right, that's margin. 😁

  • @Gearyco
    @Gearyco 5 місяців тому +6

    The challenge is when to use negative margins and when not to. There are certain instances when they're critical, but some of these examples are better suited to different techniques for various reasons. The inline overlaps of content over images, for example, are much better handled with grid. Unfortunately, I don't think Gutenberg supports the necessary grid controls to use grid in this way, forcing you to use an inferior styling technique.
    And as @wpmarkuk noted, without responsive controls this conversation is misleading. So much of what was shown can't be undone properly on mobile devices to make it functional and responsive. These are HUGE reasons why the block editor is still not ready for prime time.

  • @goatcheeta
    @goatcheeta 5 місяців тому

    Thanks, Jamie. It was in the summary of Gutenberg 18.3 but your video makes all the difference in helping us think of the possibilities, the key of education

    • @jamiewp
      @jamiewp  5 місяців тому

      Thanks Ben 👍

  • @ultraspy5474
    @ultraspy5474 5 місяців тому

    I was looking for css to overlap image and paragraph last night. You’re kinda my hero.

    • @jamiewp
      @jamiewp  5 місяців тому

      I'll take that 🙏

  • @AhsanParwez
    @AhsanParwez 5 місяців тому

    Clear concise and to the point! Thanks Jamie.

    • @jamiewp
      @jamiewp  5 місяців тому

      Thanks for watching Ahsan 👍

  • @GaryMatthews
    @GaryMatthews 5 місяців тому

    I love it❣️ Thanks Jamie for this explanation and demo. I’ve been wanting this feature for several years. It’s true we’ll need to be careful about the effect on mobile, maybe using CSS until they add breakpoint controls. But I was already using CSS workarounds anyway to get negative margins where I needed them. This is an awesome leap forward. Here’s hoping the FSE developers soon iron out the remaining kinks.

    • @jamiewp
      @jamiewp  5 місяців тому +1

      Great points Gary - it does make things easier, and this is just the first step.

    • @GaryMatthews
      @GaryMatthews 5 місяців тому

      @@jamiewp Another subtlety here is easy to under-appreciate: As I recall, in the original versions of Gutenberg full-site editing, many blocks didn't even support margins of zero! I was having to use CSS to get blocks to remain adjacent, never mind overlapping. Thank God we've matured to the point where we can make blocks touch, rather than repel one another because some developer arbitrarily chose to make them so. Zero margins are probably a more common use-case than negative ones -- and those don't adversely affect mobile.

    • @jamiewp
      @jamiewp  5 місяців тому

      @@GaryMatthews great points 👍

  • @wpmarkuk
    @wpmarkuk 5 місяців тому +9

    Nice to see them available, but without responsive controls for margin they are pretty useless. You wouldn't want a negative margin in the example you showed for example and I wouldn't expect a user to have to use CSS to fix it on mobile.

    • @Gearyco
      @Gearyco 5 місяців тому

      Great point.

    • @jamiewp
      @jamiewp  5 місяців тому +1

      Yup as I explained in the video you need to be careful how it's used 👍

    • @CampanellaFoto
      @CampanellaFoto 5 місяців тому +1

      The biggest omission from FSE and modern WordPress, such a shame because FSE would be in decent shape if they just added that.

    • @rg-web-design
      @rg-web-design 5 місяців тому

      I rarely use negative margin, but if you can create a negative margin in REM on desktop and also on mobile, then you can surely clamp the values in between for responsiveness...?

    • @Gearyco
      @Gearyco 5 місяців тому +1

      @@rg-web-design That's not always an appropriate solution and I'm not even sure if the block editor supports clamp values. Pretty sure it doesn't.

  • @TrailRunningPodcast
    @TrailRunningPodcast 5 місяців тому

    This is so basic und absolut needed! Thanks for showing this feature.

    • @jamiewp
      @jamiewp  5 місяців тому

      Thanks for watching 👍

  • @pieter-bakker
    @pieter-bakker 5 місяців тому

    Thanks for the great video. So far I managed to achieve overlap with extra css, which still gives more control, especially for the responsive part. I note that the paragraph overlap only works if the image is in the first column and otherwise you need to increase the z-index for the column with an additional css class to ensure that the text and background in the left column is above the image.

    • @jamiewp
      @jamiewp  5 місяців тому

      Oh that's a great spot Pieter - thanks for sharing 👍

  • @visualmodo
    @visualmodo 5 місяців тому

    Thanks for your video!

    • @jamiewp
      @jamiewp  5 місяців тому

      thanks for watching :)

  • @SingaporeMathsAcademyUK
    @SingaporeMathsAcademyUK 5 місяців тому

    We're finally there! This is like Apple allowing us to move icons where we want on the homescreen compared to Andorid where this was possible 10 years ago.

    • @aijokker
      @aijokker 5 місяців тому

      Who needs icons?? Just use search, its faster

  • @paulroos8517
    @paulroos8517 5 місяців тому

    Thanks Jamie. From the examples you show, it looks as if text with a transparent background could be overlaid on images using the negative margin?

    • @jamiewp
      @jamiewp  5 місяців тому +1

      Yup great idea Paul

    • @paulroos8517
      @paulroos8517 5 місяців тому

      @@jamiewp One could go even further with the idea. A small image that has been "cut out" with a transparent background, could be overlaid on a larger image used as background. And maybe animation?

  • @aabb-xe2mz
    @aabb-xe2mz 5 місяців тому

    Jamie how to change the media queries for the header, for column wrapping and other elements. Currently the default768 is entered everywhere. Is there any global way to change media queries?

  • @stimulated631
    @stimulated631 5 місяців тому

    Thanks for the update! If i use the custom builder on Wordpress it generates inline CSS in the HTML code. Is there a way to avoid this?

  • @donallong2369
    @donallong2369 5 місяців тому

    Hi Jamie,
    How does the css for mobile reset use the square brackets ?
    [style*="margin-top:-"] { margin-top: 0 !important }

  • @sjf29
    @sjf29 4 місяці тому

    I always assumed WP had this feature. When I found it didn't, I was shocked!

    • @jamiewp
      @jamiewp  4 місяці тому

      Yup it's great it's finally here

  • @Whatreally123
    @Whatreally123 Місяць тому

    Just started to build my own site on the 2024 theme. I have had so many questions, few that you have answered. My gripe with all this is the clear lack of usability of options in the settings. I don't understand why all the options are not readily shown to the user. For ex, the padding or margins don't show all options like Top/Bottom, Left/Right or individual sides all at once. Instead the user has to click the icon and then choose which option they want which just doesn't make any sense to me. Or with the Typography section. Why not show all the options like Font, style etc along with the size all the time?
    And even with the negative margin, how is one even to know about it? Unless one is a developer and closely follows release notes, there is no way they get to know this can be done. WHy not change the slider to be in the middle so as soon as one sees it, they know it can do negative values as well.
    Is there a way to suggest UI/UX changes to the wordpress gutenberg develoeprs?

  • @KaiBuskirk
    @KaiBuskirk 5 місяців тому

    SO VERY DOPE!!!!

    • @jamiewp
      @jamiewp  5 місяців тому

      Hi Kai, hope life is good - tks for watching

  • @professor7583
    @professor7583 5 місяців тому

    I literally need this so bad. When did it get released? I was literally trying to do this on something like 3 weeks ago.
    I have noticed you can't affect the margin on all blocks.

    • @jamiewp
      @jamiewp  5 місяців тому +2

      Hey Jesse, for now you’ll need the Gutenberg plugin- but it should be in core for 6.6 in July

  • @banwa_non
    @banwa_non 5 місяців тому

    awesome!

    • @jamiewp
      @jamiewp  5 місяців тому

      Thanks Juri 👍

  • @thewebstylist
    @thewebstylist 5 місяців тому

    Some things amazing how long it takes WP to bring aboard but hey all that matters is now forward 🎉
    Curious James have you ever heard of Nectar Blocks from beloved Themenectar?

    • @jamiewp
      @jamiewp  5 місяців тому

      I haven't heard of Nector Blocks nope

  • @imraan_alam
    @imraan_alam 5 місяців тому +1

    but still they have not added breakpoints for desktop, mobile and tablet.
    if i add negative margin that might not look good on mobile and there is no control for different breakpoints yet.

    • @pomade34
      @pomade34 5 місяців тому

      yeah they suck, years waiting for that

  • @carltongordon
    @carltongordon 5 місяців тому

    LETS GOOOOOO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @yvieormsby
    @yvieormsby 5 місяців тому

    Oooh! So we can have easily overlapping images - sans code! Does the code go really janky on mobile? I'd like to keep some overlapping, albeit a lesser amount

    • @jamiewp
      @jamiewp  5 місяців тому +1

      If you use the columns block and tell it not to stack (column settings) in mobile that will work 👍

    • @yvieormsby
      @yvieormsby 5 місяців тому

      @@jamiewp Thanks! I'll be trying that out ✌🏽

    • @jamiewp
      @jamiewp  5 місяців тому

      @@yvieormsby 👍

  • @bloohair99
    @bloohair99 5 місяців тому

    Hoorayyyyy! At last. Now I'll want to start tweaking my website that I've only recently tweaked, dammit!

    • @jamiewp
      @jamiewp  5 місяців тому

      Great (and sorry)

    • @bloohair99
      @bloohair99 4 місяці тому

      @@jamiewp No trouble!

  • @Sonya_Makepeace
    @Sonya_Makepeace 5 місяців тому

    I've been doing negative margins, using CSS. I hadn't tried it with WordPress though.

  • @royprins6650
    @royprins6650 5 місяців тому

    if i set the margin to overlap the image, it looks fine before publishing it.. as soon as i publish the tekst dissapears behind the image..

    • @bloohair99
      @bloohair99 4 місяці тому

      Same here. I tried this with rows and column blocks, it doesn't work for horizontal layouts for me. I can do it with rows vertically. Maybe it's something in the theme..

  • @tigmarsh13
    @tigmarsh13 5 місяців тому

    Just tried this, works great if the image is on the left but when the image is on the right, the text goes behind the image, need some way to reverse the z-index

    • @jamiewp
      @jamiewp  5 місяців тому

      Interesting- im going to do some digging. Thanks for the heads up !

    • @tigmarsh13
      @tigmarsh13 5 місяців тому

      @@jamiewp got it to work with a bit of CSS : give the overlapping sections different classes
      .overlap-right{position:relative; z-index: 9999; margin-right: -100px;}
      .overlap-left{margin-left: -100px;}
      @media (max-width: 768px) {
      .overlap-left {
      margin-left: 0;}
      .overlap-right {
      margin-right: 0;
      }

  • @Black1991Star
    @Black1991Star 5 місяців тому

    It's good, but I still can't understand why they don't implement margin and padding for Block Image ? Why it always need to be cover Block ?

    • @jamiewp
      @jamiewp  5 місяців тому +1

      I believe the plan is to add them.

  • @adelakunoluwatobi8930
    @adelakunoluwatobi8930 5 місяців тому

    Awesome

  • @carltongordon
    @carltongordon 5 місяців тому

    This should have been in there for so long now i don't understand why it was restricted

    • @FlorentClaude
      @FlorentClaude 5 місяців тому

      Does anyone know why by the way?

    • @jamiewp
      @jamiewp  5 місяців тому +2

      It's been available for a while for theme developers, but now the UI has been added in the Gutenberg plugin for end users.

    • @Black1991Star
      @Black1991Star 5 місяців тому

      @@FlorentClaude Perhaps because the value type is "number". We already have `calc()` in css but they live in last senture...

    • @FalkoJoseph
      @FalkoJoseph 5 місяців тому +1

      @@FlorentClaude it was a technical limitation for a long time. Gutenberg's margin implementation kind of prevented it.
      It would break the functionality of a lot of other things inside the editor. For example being able to select elements that overlap each other.
      It's similar to Framer, they struggled with this too, but it might be implemented by now.

    • @carltongordon
      @carltongordon 5 місяців тому

      @@FalkoJoseph this makes sense

  • @letterpool
    @letterpool 4 місяці тому

    wtf I don't have that option?????? 🤔 (margin slider)

    • @jamiewp
      @jamiewp  4 місяці тому +1

      This is coming in WordPress 6.6 (or if you install the free Gutenberg plugin today)

  • @alexandersamokhin
    @alexandersamokhin 5 місяців тому

    Now we wait another 8 years for responsive controls 😂

  • @boydriver2978
    @boydriver2978 5 місяців тому

    So,Im abroad on holidays and watching Jamie Marsland on a tablet and I'm a tad confused. I have wp 6.5 do i still have to install gutenberberg plug in? Also Caxton plug in, is that still worth installing in 6.5 or the upcoming 6.6 please @JamieMarsland

    • @jamiewp
      @jamiewp  5 місяців тому

      Hi, at the moment if you want this feature you'll need the Gutenberg plugin, but hopefully this will come to core WordPress when version 6.6 is released in July. Re Caxton , that is one of my plugins that adds extra options (eg shape dividers) into the block editor, so it depends whether you want those extra features 👍

    • @boydriver2978
      @boydriver2978 5 місяців тому

      @@jamiewp thanks