fixed some misunderstandings of css and javascript