Absolute positioning - recommended?

Discussion in 'ASP .Net' started by Iain, Oct 2, 2009.

  1. Iain

    Iain Guest


    I have certain web controls that are positioned via absolute
    positioning. The problem occurs when viewing via different browsers.
    Firefox will render the application fine, but IE7, IE8 will have the
    controls in the wrong position.

    What's the recommendation when positioning controls so it will render on
    ANY browser without issues?

    Iain, Oct 2, 2009
    1. Advertisements

  2. Webcontrols must be reusable by definition. Thus, it's strange when a
    control is absolutely positioned.
    Alexey Smirnov, Oct 2, 2009
    1. Advertisements

  3. Iain

    Iain Guest

    Not sure i follow, what do you mean by "reusable"? Are you saying that
    absolute positioning is a bad idea? Is so what are the alternative(s)?
    Iain, Oct 2, 2009
  4. Sorry, I probably misunderstood what you meant by "web controls". In
    general, absolute positioning is not bad in itself, and could be
    useful sometimes. But it's usually better to let the elements fall
    into place as the browser loads the code. Your problem is probably
    because not everything was absolutely positioned, or you have
    somewhere different borders/margins. You can try to fix it, or you can
    try to set different CSS especially for IE
    Alexey Smirnov, Oct 2, 2009
  5. Iain

    Scott M. Guest

    Where you place a control on a page has nothing to do with its ability to be

    Scott M., Oct 2, 2009
  6. Iain

    Scott M. Guest

    There is nothing inherantly wrong with absolute positioning itself, it's
    just that in order for it to work properly, you've got to understand how the
    CSS that your are writing will be interpreted in different browsers.
    Margins, borders, width, height, and padding will all play a
    part in where the final position is.

    Scott M., Oct 2, 2009
  7. I think it is impossible to accurately render every time, the first time in
    all browsers. CSS is the route I go to make it less painful, but it is not
    a "you do this in CSS and it is magic" type of answer. It just makes it
    easier to tweak, as you can leave the site up and running and change the
    CSS file rather than spinning it back up in debug and then down and then up
    and then down. Probably not the answer you wanted.

    The drag and drop Grid feature that MS put out to make it so web forms were
    like win forms is more of a pain than it is worth, if you ask me.

    Peace and Grace,
    Gregory A. Beamer, Oct 2, 2009
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.