1

I copied this link: <link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">

This is for a slideshow in my HTML. But its effects are seen for the entire body. How can I use it only for the slideshow?

Ganesh Kathiresan
  • 2,068
  • 2
  • 22
  • 33
vinya
  • 11
  • 4
  • Possible duplicate of [Limit scope of external css to only a specific element?](http://stackoverflow.com/questions/17667874/limit-scope-of-external-css-to-only-a-specific-element) – JJJ Oct 14 '16 at 12:59
  • You can't really. Either you have to modify that css file, use more specific selectors in there, or you will have to overwrite those rules for everything else in your site. – arkascha Oct 14 '16 at 13:06
  • @vinya i just found a solution for you, check my answer. – N.K Oct 14 '16 at 14:38

2 Answers2

0

May be you can find your solution in this link:-http://qnimate.com/creating-a-slider-using-html-and-css-only/

Razia sultana
  • 2,168
  • 3
  • 15
  • 20
-1

You can't do that simply because you don't own the file, so you can't modify it. That's sad for you but this file probably use "global" classes and you need to modify this file in order to delete all the body, p, div, ect... css classes so they will not affect your entire page anymore.

But, hey, I HAVE A SOLUTION for you, you see this link, yeah, this one: http://www.w3schools.com/lib/w3.css ! Just use it like any other link, you will see all the css stuff, you just need to put it in your own css file then modify it.

Hope that will help you.

N.K
  • 1,601
  • 2
  • 19
  • 31
  • What about the license? How can you be sure vinya can just include a css derived from that style sheet into their project? – Андрей Беньковский Oct 14 '16 at 16:22
  • @АндрейБеньковский w3 use it's own "bootstrap" css style, and it's completly free to use, but you are right, he need to link the good refs in order to be able to run the custom classes inside this css file, but the "links" to add on the head are also provided on w3schools. Also it seems that he can use the css file, i mean that in his answer he said that the css styles are applied, he just want to take the global ones out (bod, p, ect), thats why i recommend him to download the file and modify it. – N.K Oct 16 '16 at 10:50