images - How to target only one element if more elements share the same CSS class

I am developing a website in wordpress using flatsome theme. I am facing a problem of images sizes. Actually all the thu

I am developing a website in wordpress using flatsome theme. I am facing a problem of images sizes. Actually all the thumbnails share the same class of CSS so when I change this class for one image all the other image sizes changes as well but I do not want that.

I want to change the image thumbnail size of only one page and the rest of the image thumbnail sizes should be same although they are sharing same class. Please help in this regard.

I am developing a website in wordpress using flatsome theme. I am facing a problem of images sizes. Actually all the thumbnails share the same class of CSS so when I change this class for one image all the other image sizes changes as well but I do not want that.

I want to change the image thumbnail size of only one page and the rest of the image thumbnail sizes should be same although they are sharing same class. Please help in this regard.

Share Improve this question edited Jul 11, 2019 at 6:24 Itstudent asked Jul 11, 2019 at 6:06 ItstudentItstudent 32 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I don't know how comfortable you are with development, but it is possible to do what I think you're asking.

Option 1: Customize the theme templates to apply a different class to the first item. Requires some WordPress templating and php know-how.

Option 2: Use css pseudo classes to target the first image with that class and give it different styles (something like .yourclass:first-child{ border: 1px solid red; } ). Requires some css/less/sass know-how (not sure how the theme is set up). Without seeing a sample page I can't tell you much more than that.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745328940a4622787.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信