Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

Delete an element on a webpage

more options

Okay so basically for example lets say i want to permanently just for my screen have this image deleted/or hidden whatever how can I do this without using an extension?

I believe someone brought up usercontent.css?

Okay so basically for example lets say i want to permanently just for my screen have this image deleted/or hidden whatever how can I do this without using an extension? I believe someone brought up usercontent.css?
Đính kèm ảnh chụp màn hình

Tất cả các câu trả lời (1)

more options

In your other thread, you said you didn't want to use an add-on, you wanted to do it the hard way. ;-)

The userContent.css file holds style rules. For example:

selector { display: none !important; }

The trick is to figure out what CSS selector is associated with the element you want to hide, and it needs to be specific enough not to hide other things you don't want to hide. This is going to differ from one page to the next and typically takes some "hands on" work.

You already know how to use the Inspector, so you might find a unique selector based on an id, or one based on a class that you can make unique based on an ancestor element.

For a deeper dive: https://developer.mozilla.org/docs/Learn/CSS/Building_blocks/Selectors

To set up a userContent.css file, you use the same steps as a userChrome.css file but the file name is different. Also, you need to know about this feature if you want your rule only to apply to particular sites or pages:

https://developer.mozilla.org/docs/Web/CSS/@document

Note: Firefox requires it to be written with -moz- as @-moz-document.