Preserve the original CSS ID and classes in the alias elements (see #6638)