Html and CSS

Posted in: Newspaper
Post count: 134

Hi guys!

When I add a custom HTML code with Visual composer how can I put custom CSS that applies only to that HTML code. I tried putting it in Theme panel> Custom code > CSS area but it loads on every page and it become a mess.
I need to know where to put the CSS to only apply to the HTML I want.

Thanks!

Post count: 6535

Hi

You can put the css code in the same html row added with Visual Composer: http://screencast.com/t/TH1pF5q8T Also you can target a specific page by using its page-id-abc class.

Thanks!

Post count: 134

It is not working properly when I do it as shown in the picture.

And one more question, how to insert javascript code that only loads for that code?

Thanks!

Post count: 6535

Hi

Css works fine as I’ve indicated above but it has to be written properly, here is an example: http://screencast.com/t/tP1LgMMjQjqwhttp://screencast.com/t/RWjddpCKcn

Check these links for more details about how to target containers with js: https://api.jquery.com/hasclass/ -https://api.jquery.com/append/ – https://api.jquery.com/removeclass/ These are only few examples but there are many ways in which you can target a container, but that depends by the action which will be executed on it.
Keep in mind that this is not a copy paste task, you can’t just say to js “hide that container”. First you have to understand what js can do, how it works then do some tests on your side to check how it works. A staring point in learning js could be here: http://api.jquery.com/http://www.w3schools.com/js/default.asp

Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.