Adding rounded corners or CSS to images
Permalink
How do I attach a style to the image tag?
If I make a new block and add an image to it I can't add a class. It will let me add a class to the block via "Design & Custom Template" but it does't attach itself to the image tag. It adds it to the block
If I select edit block to get the properties of the image it doesn't have anywhere to enter css information
If I make a new block and add an image to it I can't add a class. It will let me add a class to the block via "Design & Custom Template" but it does't attach itself to the image tag. It adds it to the block
If I select edit block to get the properties of the image it doesn't have anywhere to enter css information
When you add a custom class to a block using Design & Custom Template, the block is wrapped in a div, and that div is assigned the custom class.
Example:
- add an Image block to a page
- select an image
- save the block
- click the block again and choose "Design & Custom Template"
- in the Design & Custom Template toolbar, select the gear icon
- in the Custom Class text input, enter "rounded-corners"
- save
- after saving, the Image block is wrapped in a div that will include several classes, one of the classes will be "rounded-corners"
- when you write your CSS to target that img, you start with "rounded-corners" and then the child img element