0

I have the following:

  if($skoleIsSet && !$eventIsSet) {
        foreach($events as $event) {
            if($event['skole_id'] == $skoleIsSet) {
                $bg = $event['img_url'];
                echo '<div id="events" style="background-image: url(<?php echo $bg; ?>);">
                <h1>' . $event['title'] . '</h1>';
                echo '<p>Beskrivelse: ' . $event['description'] . '</p>';
                echo '<p>Pris: ' . $event['pris'] . '</p>';
                echo '<p>Dato: ' . $event['date'] . '</p></div>';

    }

I want every event echo'ed to have the url from the img_url column as a background image. What am i doing wrong?

edit (Css for #events)

    #events{

        float: left;
        line-height: 1px;
        text-align: center;
        opacity: 0;
        padding-top: 16px;
        width: 30%;
        animation-name: eventsAnim;
        animation-duration: 4s;
        animation-fill-mode: forwards;
        position: relative;
        margin: auto;



    }

Thanks!

0 Answers0