hivolih247
hivolih247

Reputation: 81

Hiding span under div in CSS

Below is the code for my WP post. I'm trying to hide the span for comment. So that it doesn't appear on the blog post.

<div class="blog-stats">
    <span class="clock">
        <i class="fa fa-calendar stats-item"></i>
        <span class="text-center text-light stats-item">February 15, 2020</span>
    </span>
    <span class="comment">
        <i class="fa fa-comment stats-item"></i>
        <span class="text-center text-light stats-item">no comments</span>
    </span>
    <span class="user">
        <i class="fa fa-user stats-item"></i>
        <span class="text-content text-light stats-item">Wayne John</span>
    </span>
</div>

I tried a few below and it didn't work.

.blog-stats.comment {
    display: none;
}

span .comment {
    display: none;
}

span.comment {
    display: none;
}

Any idea how to fix it?

Upvotes: 0

Views: 2250

Answers (5)

Keyur Gajjar
Keyur Gajjar

Reputation: 360

Please put this code in your css

.blog-stats span.comment{display: none;}

Upvotes: 0

Ismail Vittal
Ismail Vittal

Reputation: 1103

In case if you don't want to use !important try the below version.

.blog-stats .comment.comment {
   display: none;
}

Note: You can increase the .comment class x number of times to get higher precedence.

Example:

.blog-stats .comment.comment.comment {
   display: none;
}

Upvotes: 0

Deepak
Deepak

Reputation: 55

please put space between classes like

.blog-stats .comment {
    display: none;
}
or
.blog-stats .comment {
   display: none !important;
 }

this will work please try

Upvotes: 0

Himanshu Joshi
Himanshu Joshi

Reputation: 292

Add below CSS and try :

<style type="text/css">
    .blog-stats .comment span{
          display: none !important;
      }
 </style>

Upvotes: 2

Saeed Jamali
Saeed Jamali

Reputation: 1195

your CSS code is OKAY!

try putting "!important" besides your style and clear your browser cache. maybe fixed.

Upvotes: 0

Related Questions