I have a view in Drupal 8, and have configured a field in the view to have a custom CSS class.
The field I am adding the class to is an image. Under Style Settings I have chosen “Customize field HTML” and “Create CSS class”.
When I inspect the image element on the front end, the class is nowhere to be found, and the styles are not applied.
I also have a view fields template for this view named:
views-view-fields–home-page-top-three-stories.html.twig
{{ fields.field_story_preview_image.content }} <div class="story-title-box"> <h3>{{ fields.title.content}}</h3> <h4>{{ fields.field_subtitle.content }}</h4> </div>
“fields.field_story_preview_image.content” is the image field that I would like to apply the CSS class to. Am I missing a configuration step?
Why isn’t the CSS class being applied to this image field?