my css was too messy because like negative margins and lots of other stuff. what do i do when i get alot of negative margins?

  • This doesn't answer your question about getting rid of negative margins, but this online resource will clean up your CSS - Mottie over 8 years ago

1 answer

o.k.w 2355

I guess your question is somewhat related to your earlier one at, yea?

Though I did cleaned up quite a bit of your CSS in that problem, the main issue I guess is, how NOT to get messy in the first place. And to do that, you need to really have a good idea of HTML-CSS layout/design.

Are you using a 3rd party software to edit your page? I asked because it seems like a convenient method to get what you want visually by dragging the HTML elements. This might result in the 'mess'.

I would suggest sketching out your layout and then think before act on how to achieve the placements, sizes, etc.

For the case of an already messy CSS, personally I would recommend re-do. Either from scratch, or start from top-down, out-in to examine each element.

You need to understand that as much as possible, use margins to tweak your element placements, not to position them to somewhere hundreds of pixels away from the original position. If it helps, remove all margin styles and work from there. Place in margin for fine-tuning. That's what I did for your Safari problem.

Anyway these are just my own opinion. I've seen implemetation using all sort of margins yet neat and nicely rendered across browsers.

Answered over 8 years ago by o.k.w