adds the relevant CSS and id
retab and strip trailing whitespace