Verwendung: Feature Box: image zu background-image machen
Produkt: Custom Elements Contao
In der Feature Box gibt es die Möglichkeit, ein Bild darzustellen - eine Hälfte Bild, eine Hälfte Text.
Ich würde dieses Bild gerne als background-image platzieren, damit es besser über CSS manipuliert werden kann.
Wie muss der Template-Code angepasst werden:
<?php if ($image = $this->getImageObject($this->image, $this->size)): ?>
<div class="feature-box-image" >
<?php $this->insert('picture_default', $image->picture) ?>
</div>
<?php endif ?>
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by RockSolid Theme... on 23 Dec, 2021 10:36 AM
Vielen Dank für Ihre Frage.
Mit folgendem Template-Code lässt sich ein Hintergrundbild umsetzen.
Beachten Sie dabei bitte, dass das
.feature-box-image
-Element eine Höhe via CSS gesetzt bekommen muss damit das Bild sichtbar wird.