I have a Wordpress Website and in a Theme I load some Data: if the div.description is empty, the height of description should be 0. But it's not working. Here is the Code how it's shown in the Browser: maybe is not considered as empty? (PS: Using SASS
.one-project {
.description {
height: 0;
}
&:hover {
.description {
height: 50px;
}
.description:empty {
height: 0px;
}
}
This is the output in the Browser:
<div class="one-project">
<div class="details">
<div class="title">My Title</div>
<div class="description"/>
</div>
</div>
This is how it is in my Template (Wordpress)
<div class="description">
<?php
$shortexcerpt = get_field( 'excerpt' );
echo ($shortexcerpt ? $shortexcerpt: '');
?>
</div>