[英]Building a HubL template with an array of objects editable by user in page edit
[英]adjusting the position of image in hubl template
我是hubl代碼模板開發的新手..我正在尋找某種方式來調整同一模板中圖像的position..我希望go的圖像稍微超出屏幕,同樣想要ZC7A628CBA22E28EB667的“對象擬合”屬性。 .但我堅持在這個hubl模塊上添加rhis屬性..誰能幫我這是我的代碼片段
{% dnd_module path="@hubspot/linked_image",
img={
"alt": "my portal image",
"loading": "lazy",
"max_width": 650,
"size_type": "auto_custom_max",
"src": get_asset_url("./images/Portal.png"),
},
horizontal_alignment="RIGHT",
%}
我不完全確定您要完成什么,但您可以在 dnd_module 中的圖像上放置一些 css,如下所示:
.dnd-module span img {
object-fit: cover;
width: 100%;
height: 200px;
}
請注意,這將適用於模板中具有 dnd 圖像模塊的所有圖像。
更好的解決方案是創建一個自定義模塊並添加您需要的自定義 css,然后將該自定義模塊路徑添加到 dnd_module。
這將比使用開箱即用的linked_image提供更多的可定制性,現在您可以在您需要的任何模板中重用自定義圖像模塊。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.