简体   繁体   中英

How to use display:none to remove element?

I would like to remove the element that is high lighted in blue on the below screenshot.

If I add the following to the CSS

#p-tb body, { display:none }

it is still not removed.

Can someone explain what I am doing wrong?

在此处输入图片说明

#p-tb .body is the selector you need - you missed the . and have an extra , freeloading on the end.

EDIT: Although, even if you correct that, the inline style will override that rule, except maybe if you add !important after the display:none .

Display:none only hides the element. You can't remove an element via CSS.

Use javascript instead!

Be careful using display: none; on elements that can contain text. You could find yourself getting into SEO problems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM