Hello,
The option "before" or "after" supports adding HTML tags outside of HTML field, like a wrapper. The conditional logic show/hide the HTML field only so the additional HTML tags are not affected. You can use the Inspect tool to see the HTML structure.