Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.
Level 1
Level 2
Melden Sie sich an, um alle Badges zu sehen
Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.
In the complex component, how to make the image as background image and the text as center align on the background image??
Gelöst! Gehe zu Lösung.
Zugriffe
Antworten
Likes gesamt
It should be taken care in your CSS making image as background and text as center aligned for that div
Zugriffe
Antworten
Likes gesamt
It should be taken care in your CSS making image as background and text as center aligned for that div
Zugriffe
Antworten
Likes gesamt
bsloki wrote...
It should be taken care in your CSS making image as background and text as center aligned for that div
<%@include file="/libs/foundation/global.jsp"%>
<%@ page import="com.day.cq.wcm.foundation.Image" %>
<%
Image image = new Image(resource, "image");
image.setSelector(".img");
String text = properties.get("text", "TEXT NA");
%>
<%= text %>
<%
image.draw(out);
%>
<%
image.getDescription().length();
%>
i m using this code...how to have the css inside it
Zugriffe
Antworten
Likes gesamt
The image object has a getSrc() property. You can switch your code up to utilize it:
<%
Image image = new Image(resource, "image");
image.setSelector(".img");
String text = properties.get("text", "TEXT NA");
%>
<%= text %>
<div style="background-image: url(<%=image.getSrc() %>);"></div>
Zugriffe
Antworten
Likes gesamt
Zugriffe
Likes
Antworten
Zugriffe
Likes
Antworten
Zugriffe
Likes
Antworten