For compatibility with IE the parsing algorithm should probably ignore </li> tags. Test case for the above proposal: <!doctype html> <style> * { margin:0; padding:0; } ul { background:red; } li { background:lime; } </style> <ul><li></li>This line should be green.</ul> -- Simon Pieters