How to give classname to post if post has no content?

As Tom J Nowell mentioned in his comment, it is not clear what do you want to accomplish. If you want to just show your empty content div, you can use CSS as follows:

div:empty {
    width: 100%;
    height: 20px;
    margin-bottom: 10px;
    background: #ff0000;
}

It will show your empty content div as a nice, red band.