The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS top is not working

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #33517

    slk - index

    now left property of the div is working but the top is not working.
    I have to run this page in mobile browser…

    Rob MacKay


    Firstly what are you trying to do – what do you want it to do. Don’t expect people to answer if you don’t give full and proper information.

    Please expand on what you want help with.


    Also, why are you using inline styling over adding it to your stylesheet?


    i believe he is having problems getting the div to position in the window using the property top and specifying the amount. He said so in the title I do not understand why he felt the need to specify that it is for a mobile browser when he hasn’t provided any other details, but that is the basic outline of his problem.


    Sorry, if i am unable to communicate.
    Actually, I’m getting absolute top-left positions(with height-width) in pixels of the elements from front-end.(with reference 400*400 resolution)
    My job is to convert this positions in such a way that (i hope in percentage) so that it works on every mobile browser.
    Please tell if you need further information.


    change the body to relative and your div to absolute;

    remember that the element you want to position with “top and left/right” must be absolute and the element you want to refer to must be relative


    @KarimCossutti’s working
    but the problem is that when the content of the div flowing out of the specified height in smaller devices, due to absolute positions, elements overlaps each other. what to do now??


    what about media queries?


    @KarimCossutti : how it will help me in maintaining relative distance of elements which are positioned absolutely.???
    If you have any such media query please specify??

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘CSS’ is closed to new topics and replies.