Custom Styles isn't working

Enonic version: 7.6.0
OS: Ubuntu

The styles that I’m putting in my css aren’t working. I can see the class in the figure tag when inspecting in the browser, but no css is applied in that class.

My main/resources/site/styles.xml :

<styles css="styles/styles.css"
	xmlns="urn:enonic:xp:model:1.0">
	<image name="medium-style-image">
		<display-name>Medium</display-name>
	</image>
</styles>

My css file in main/resources/assets/styles/styles.css:

.medium-style-image {
	width: 400px !important;
}

.medium-style-image img {
	width: 400px !important;
}

I just want to make the image have a width of 400px when the style is applied.
Thank you.

EDIT: It’s now solved. I had to also add the CSS file as a link tag in the default page HTML. That solved the problem.

2 Likes