Affecting CSS inside K2 Items View Only

GK User
Tue Feb 03, 2015 9:55 am
Hello, I want to do important CSS work inside K2 Items layout view, but I do not want it to affect Category view, tag or search view.

I know it is possible to assign a Class to a menu Item then work on the CSS that way to restrict the commands, but from what I understand, that means that I would need to create a class for each K2 Item or the other way around; for evey view that is NOT a K2 Item.

I was wondering if there was a way that I am not aware of (probably as I am merely a beginner in CSS).

Here is what I need to do inside K2 Item Layout View, but this will affect all .itemImage, .itemImageBlock views.:

Code: Select all
/* Image Item Resize */

.itemImage, .itemImageBlock {
   max-width: 75% !important;
        margin-left: 20%;
}

.k2store .product_price {
   margin-top: -225%;
}



Link to item example: http://gator4199.hostgator.com/~lgt2015 ... -oz-355-ml

Link to Category view: http://gator4199.hostgator.com/~lgt2015/cosmetics
Thank you,
Regards
User avatar
Platinum Boarder

GK User
Tue Feb 03, 2015 11:44 am
The only thing that comes to my mind is to use:
Code: Select all
div:not(.itemList) article.itemView

prefix to your css
User avatar
Moderator

GK User
Tue Feb 03, 2015 11:51 am
Code: Select all
/* Image Item Resize */

.article.itemView .itemImageBlock   {
   max-width: 75% !important;
}



Is this right?
Thanks
User avatar
Platinum Boarder

GK User
Tue Feb 03, 2015 11:57 am
Code: Select all
/* Image Item Resize */

div:not(.itemList) article.itemView  .itemImageBlock   {
   max-width: 75% !important;
}

for single article and:
Code: Select all
/* Image Item Resize */

div.itemList article.itemView  .itemImageBlock   {
   max-width: 75% !important;
}

for category listings
User avatar
Moderator

GK User
Tue Feb 03, 2015 12:11 pm
Thank you cyberek!

It worked but I had to switch them, am I right with this code?

Seems to work...

Code: Select all
/* Image Item Resize */

div:not(.itemList) article.itemView  .itemImageBlock   {
   max-width: 55% !important;
}


/* Image Categoy Item Resize */

div.itemList article.itemView  .itemImageBlock   {
   max-width: 100% !important;
}


Category: http://gator4199.hostgator.com/~lgt2015/cosmetics

Item:http://gator4199.hostgator.com/~lgt2015/cosmetics/thayers-rose-petal-witch-hazel-with-aloe-vera-formula-alcohol-free-toner-12-fl-oz-355-ml

Regards.
User avatar
Platinum Boarder

GK User
Tue Feb 03, 2015 5:31 pm
Depending what you want to achieve. Add the code and see the result - if it suits your needs there is nothing else to add ;)
User avatar
Moderator

GK User
Wed Feb 04, 2015 5:58 am
Thank you Cyberek, you are brilliant.
This CSS trick will stay in my book for sure.

Regards
User avatar
Platinum Boarder

GK User
Wed Feb 04, 2015 11:05 pm
I'm glad you learn so fast :)
Please let me know if you would have any additional questions regarding this topic.
User avatar
Moderator


cron