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: block;
is the only display
applied, inherited or shadowed or whatnot)
#p-tb .body { display:none !important}
did the trick. What does !important
do?
Commented
Apr 19, 2012 at 21:27
!important
gives the property unusually high precedence. Normally inline style="..."
attributes have higher precedence than any stylesheet will allow, but the !important
overrides even that. That said, !important
is usually seen a sign of poor design.
Commented
Apr 19, 2012 at 21:28
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.
display: none
removes elements from the DOM. You need to tell us what exactly you mean by "removing" the element.