Hide DIV when content displayed is has NULL value in database
<p>I have a font awesome div which floats on top on my image, to give the image details, which are extracted from the mysql database. </p>

<p>When I hover over this (info) font awesome icon, a tiny inline opens up with the content from mysql.</p>

<p>Now when the content is NULL, I don't want the font awesome to show up at all.</p>

<p>the following is my code. </p>

<pre><code>&lt;div id="hotspot1" class="hotspot" style = "position: fixed;"&gt;
                &lt;i class="fa fa-info-circle" style="font-size:48px;color:cyan"&gt;&lt;/i&gt;
                &lt;div class="hover-popup well"&gt;
                &lt;?php 
                    if ($details == null) {
                        echo "class='display-none';";
                    }
                    else {
                        echo $details; 
                    }
                    ?&gt;
                &lt;/div&gt;
            &lt;/div&gt;
</code></pre>

<p>The CSS for this hover pop up is</p>

<pre><code>#hotspot1 {
            right:93%;
            top:3%;
        }

        .hotspot {
            line-height:20px;
            text-align:center;
            position:absolute;
            cursor: pointer;
        }

        .hotspot .text {
            width:80px;
            height:20px;
        }

        .hover-popup {
            display:none;
            z-index:auto;
        }

        .hotspot:hover .hover-popup {
            display:inline;
            position:absolute;
            left:100%;
            top:0;
            width:300px;
            height: auto;
            border:2px solid #000;
            margin: 20px;
            padding: 20px;
            font-size: 16px;
            background: #FBF0D9;
            font-style: oblique;

        .display-none {
            display:none;
        }
</code></pre>

<p>Now when there is a null value, it literally displays "class = 'display-none'"</p>

<p>What can I do to vanish the icon totally during null values?</p>

<p>Should I use JS or JQuery?</p>