Hi Guys
I need to style a certain block, what is the correct code please:
#data-theme-editor-block-38162849744="{"id":"1602838770919","type":"text-columns"}" {
margin-top: -250px !important;
}
Thanks
Hi Guys
I need to style a certain block, what is the correct code please:
#data-theme-editor-block-38162849744="{"id":"1602838770919","type":"text-columns"}" {
margin-top: -250px !important;
}
Thanks
@jamescox1981 Please provide a link to your store, and a screenshot of the block you want to style.
Hi
Password: Fib01!
Just this block:
Thanks!
Hi @jamescox1981
The below section relates to that picture, although this will effect the others aswell, give the section another class to make it unique.
.index-section.index-section--alt {
}
The correct selector for that element is .index-section .index-section–alt
To style it you would need to use the following
.index-section .index-section--alt.{
margin-top: -250px !important;
}
Please note this element does not have a unique identifier so this will style other instances of this block. If you want to target only this block you will have to add an id.
Thanks - can i not use the id in the string:
#data-theme-editor-block-38162849744="{"id":"1602838770919","type":"text-columns"}"
Hi @jamescox1981
There’s no id on that section, where did you find that?
@jamescox1981 no you cannot. It looks like you have copied this from inside the theme editor.
If you are going to use inspect element to find the selectors you have to use it on the customer-facing view of your website.
ok - I used my dev tool selector to find it - noted i should use the customer view.
How would i add an ID to this div if it is auto generated by the theme customisation menu? Do you know what liquid file would i have to amend?
Thanks
@jamescox1981 There is a simpler solution that may be more appropriate for you, but taking this route would mean changing your blocks would require your to update the code.
.page-blocks > div:nth-child(2) > div{
margin-top: -250px !important;
}
if you reorder or change the block you will have to change the number in the :nth-child(change).
Many thanks!