to add style. remove preview if only want edit<style data-sly-test="${wcmmode.preview || wcmmode.edit}">.myClass { height: 720px;}</style> In your case, I suggest<div data-sly-test="${wcmmode.edit}" class="abcd xyz myclass"> ..context here.. </div><div data-sly-test="${wcmmode.preview || wcmmo...