Skip Navigation

[Resolved] View custom CSS is affecting the whole page

This thread is resolved. Here is a description of the problem and solution.

Problem:
View custom CSS is affecting the whole page

Solution:
You need to add your custom CSS in such a way that it should not be applied on the whole page by selecting the proper CSS selector.

You can find the proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/view-custom-css-is-affecting-the-whole-page/#post-1132568

Relevant Documentation:
=> https://www.w3schools.com/cssref/css_selectors.asp
=> https://www.w3schools.com/cssref/sel_element_element.asp

This support ticket is created 6 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Ben 5 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#1131505

Ben
View CSS Editor.png

I have entered some custom CSS to a View using the CSS Editor in Views. Please see the attached screenshot.

The CSS seems to be affecting the whole page and not just the content of the View. Is this expected? Is there any way to limit it to just the View so any content or text outside of the View is unaffected by this CSS?

#1131935

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - could you please share problem URL where I can see the issue? to which section you want that the CSS you added should be applied?

#1132108

Ben
Page after CSS.png
CSS.png
Page before CSS.png

Hello Minesh.

The problem is currently on a local site. I will try and describe the problem with screenshots but if this does not help I can try and duplicate the problem somewhere online for you.

Please see attached screenshots.

I have a page which shows a Toolset View on the left side and some static links on the right. (Page before CSS).

I use the CSS editor in Views to change the colour of the links to red. (CSS).

This changes not only the links in the View but also all the other links on the page. (Page after CSS)

How can I "restrict" the CSS so that any CSS inserted into the CSS editor only affects the CSS of the View?

#1132568

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - the issue you described here is the pure CSS issue. You need to add your custom CSS in such a way that it should not be applied on the whole page by selecting proper CSS selector.

Please check following links that may help you:
=> hidden link
=> hidden link

For example:

.js-wpv-view-layout a { color:red; }

Above CSS will be applied to all anchor tags within the view.

#1157135

Ben

Thank you Minesh.