<style> div::before { content: "before"; } div::after { content: "after"; } </style> <div> before <!-- Rest of stuff inside the div --> after </div>