1

is there a way to disable a css element on youtube permanently? i need to play my videos in the left part of the screen and run my text editor in the right. for some reason youtube has a margin on the left of the video box which i can only disable by unchecking the #page.watch .content-alignment { max-width: 1066px; } css element.

this works fine but i have to do this every time i run a video which is becoming annoying. i've tried stylish but it didn't work. i'm using google chrome.

thanks.

ronca85
  • 43
  • 5

3 Answers3

1

Option 1

You can try to override a CSS setting by using !important.

#page.watch .content-alignment {max-width: 500px !important}

This will force the max-width of that element to 500px. I don't think there is a way to turn off the max-width setting in CSS.

What are the implications of using "!important" in CSS?

Option 2

You could also try removing the .watch and .content-alignment classes from the tag by using javascript.

Change an element's class with JavaScript

Community
  • 1
  • 1
Kris Hardy
  • 548
  • 4
  • 12
1

Chrome disabled the user stylesheet back in version 33, so the only way now to modify a css property is through plugins like Stylish (which I see you’re using).

max-width: none; is what I think you’re looking for.

Try Stylish again—I just tested it and was able to remove the margin you mentioned. I used:

#page.watch .content-alignment {max-width: none;}

0

There is nothing you can do permanently. The markup to set that is served from YouTube. You have no control over that. You can do things, as suggested by others, but those are only temporary. As soon as you change videos, or refresh the page, then the original settings come back; served by YouTube.

And all that completely ignores that YouTube may change that page one second later. And again the next day. Nothing on the web is permanent.

Rob
  • 14,746
  • 28
  • 47
  • 65