-
Hi there!
Previously, someone helped me with custom CSS code that would resize images to be wider than the container of my post body. Here is the code he provided me:
.single-post figure.gb-block-image
{
margin-left: calc(-100vw / 2 + 100% / 2);
margin-right: calc(-100vw / 2 + 100% / 2);
max-width: 100vw;
width: auto;
text-align: center;
}@media (min-width: 1400px) {
.single-post figure.gb-block-image img {
max-width: 1400px;
}
}I was wondering, is there a way I can update the code so that if I add a GenerateBlocks image block with an additional CSS class such as “no-resize” that it would not resize the image?
I tried this, but it broke all the other images on the post.
.single-post figure.gb-block-image img:not(.no-resize)
{
margin-left: calc(-100vw / 2 + 100% / 2);
margin-right: calc(-100vw / 2 + 100% / 2);
max-width: 100vw;
width: auto;
text-align: center;
}@media (min-width: 1400px) {
.single-post figure.gb-block-image img:not(.no-resize) {
max-width: 1400px;
}
}Thanks in advance!
-
Hi there,
not easily, as the class gets added to the
img
and you would need it on thefigure
To do that would mean having to add another container around the image block.
Question which will be more common ? The wide images or theno-resize
image ?
- You must be logged in to reply to this topic.