tag:help.rocksolidthemes.com,2012-07-23:/discussions/contao/73364-verwendung-feature-box-image-zu-background-image-machenRockSolid Themes: Discussion 2021-12-23T10:36:07Ztag:help.rocksolidthemes.com,2012-07-23:Comment/495599812021-12-23T10:36:05Z2021-12-23T10:36:05ZVerwendung: Feature Box: image zu background-image machen<div><p>Vielen Dank für Ihre Frage.</p>
<p>Mit folgendem Template-Code lässt sich ein Hintergrundbild umsetzen.</p>
<pre>
<code><?php if ($image = $this->getImageObject($this->image, $this->size)): ?>
<div class="feature-box-image" style="background-image: url('<?= $image->src ?>');">
</div>
<?php endif ?></code>
</pre>
<p>Beachten Sie dabei bitte, dass das <code>.feature-box-image</code>-Element eine Höhe via CSS gesetzt bekommen muss damit das Bild sichtbar wird.</p></div>RockSolid Themes