How do i get rid of the padding around the widget inside the border?

164 Views Asked by At

enter image description here

The first image is what i have and the second is the result i want to accomplish.

enter image description hereso far ive realised that disabling the two ticks (in the picture above) does the trick but how do write the css code?

Here's the code im currently using to adjust the widget to my liking.

span[data-pin-log="pinterest"] {
    overflow: scroll;
    overflow-x: hidden;
}
span[data-pin-log="embed_grid"]::-webkit-scrollbar {
    width: 0;  /* Remove scrollbar space */
    background: transparent;  /* Optional: just make scrollbar invisible */
}
/* Optional: show position indicator in red */
span[data-pin-log="embed_grid"]::-webkit-scrollbar-thumb {
    background: #FF0000;
}

#pinterest [class$=_button] {
  display: none !important;
}
#pinterest [class$=_button] {
  display: none !important;
}
#pinterest [class$=_hd] {
display: none !important;
}
body > span[data-pin-log="embed_grid"] {
  border: none;
}
<a data-pin-do="embedBoard" data-pin-board-width="350" data-pin-scale-height="500" data-pin-scale-width="130" href="https://www.pinterest.co.uk/toastedmacarons/rich-boys-city-girls/"></a>
<script async defer src="//assets.pinterest.com/js/pinit.js"></script>

If it helps this widget is live on here.

I have very limited knowledge on CSS so any help is appreciated. Thank you in advance :))

1

There are 1 best solutions below

0
rozsazoltan On

Follow my css code:

/* Remove scrollbar */
body > span[data-pin-log="embed_grid"] > span[data-pin-log="embed_grid"] {
    overflow: scroll;
    overflow-x: hidden;
}
body > span[data-pin-log="embed_grid"] > span[data-pin-log="embed_grid"]::-webkit-scrollbar {
    width: 0;  /* Remove scrollbar space */
}

/* Remove border */
body > span[data-pin-log="embed_grid"] {
  border: none;
  padding: 0 !important;
}

/* Remove padding */
body > span[data-pin-log="embed_grid"] > span[data-pin-log="embed_grid"] {
  padding: 0;
}

/* Hide header (pinterest logo) */
body > span[data-pin-log="embed_grid"] > span[data-pin-log="embed_grid"]:first-child {
  display: none;
}

/* Hide follow button */
body > span[data-pin-log="embed_grid"] > span[data-pin-log="embed_user_ft"]:last-child {
  display: none;
}

Full example on Codepen