最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论