how to catch some elements on html without any properties?

时间:2017-08-04 12:42:52

标签: css html5

I'm trying to make a display: none; at "founds 2 result" et "page 1 to 1" but I don't know how to catch them. Thanks a lot !

enter image description here

2 个答案:

答案 0 :(得分:0)

try with css

.search-filter-results#search-filter-results-540{
  display:none;
}

or Js

var element=document.getElementById('search-filter-results-5');
  element.style.cssText="display:none;";

答案 1 :(得分:0)

Can I select a text element that is outside HTML tags?

You can't because the text you want to modify is not an element.

You should always write content inside tags, let them be <span> or <p> tags. This way you can easily select them, style them etc...

In your case you can still work around this by selecting the closest parent element hoping that it doesn't hold other elements you don't want to affect:

.search-filter-results {

  display: none;

}

Again I'm not sure that search-filter-results only contains the elements you want to hide. Maybe it contains other elements, in this case it will hide it too.