-
Saukko
Hi
I am having a hard time adjusting to Blocks 2.0.
Today I’ve spent like 2 hours trying to figure out how to target the anchor wrapper of the Image block IMG. I can’t center the image with the link because the A spans 100% of the container.
If I select Image block and go to Manage selectors > Links, the style creates a selector: .image-class a. This does not select the wrapper A (the HTML markup is
).
Markup:
<a href="/"><img class="gb-media-db542c51" --></a>Added style:
.gb-media-db542c51 a { display: block; width: 900px }Should be:
<a href="/" class="CUSTOM-CLASS-HERE"><img class="gb-media-db542c51" --></a>How to style the wrapper anchor element with style editor?
-
Alvind
Hi there,
You can wrap the Image block inside a Container. Then, select the Container and use the Style selector to target Links, this will apply styles to the anchor tag of the the image.
-
Saukko
This solution works, but it is not ideal that you do not have any control over the A-wrapper within Image block.
-
Alvind
I’m not sure I understand what you mean by “the wrapper within the Image block.” The anchor element is outside, wrapping the Image block, so the solution I suggested by targeting the
<a>tag from the wrapper container should work. -
David
Hi there,
thanks for raising the issue, as you have pointed out, the
linkstyle selector doesn’t work for the image block and actually it should be removed as its redundant. I’ll get an issue raised to correct that.To center the Image Block without the additional wrapper try:
1. select the image block
2. set the Layout > Display to Block
3. set the Layout > Spacing > Margin toauto
- You must be logged in to reply to this topic.