Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    kin
    kin is offline
    New Coder
    Join Date
    Jul 2011
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Is the only way to achieve screen size based positioning...

    Is to use javascript in relations with CSS? If this is not the case then can someone point me in the right direction?

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,925
    Thanks
    6
    Thanked 1,040 Times in 1,013 Posts
    It depends on what you’re up to.

  • #3
    Regular Coder
    Join Date
    Jul 2011
    Location
    India
    Posts
    496
    Thanks
    3
    Thanked 57 Times in 56 Posts

  • #4
    kin
    kin is offline
    New Coder
    Join Date
    Jul 2011
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VIPStephan View Post
    It depends on what you’re up to.
    Whatcha mean?




    Quote Originally Posted by vikram1vicky View Post

    There's that thread of mine I was looking for haha. I knew I posted it a while back but could not find it. I am a newb with vbulletin forums.
    Last edited by kin; 07-31-2012 at 05:13 AM.

  • #5
    Regular Coder
    Join Date
    Jul 2012
    Location
    London
    Posts
    473
    Thanks
    4
    Thanked 86 Times in 86 Posts
    Quote Originally Posted by kin View Post
    Whatcha mean?
    He means, what are you going to use it for?

    • Resize your website on the resolution the user has;
    • Display there screen size and ask them to change it.
    • Change elements/div in your website on a curtain resolution.


    :P

  • #6
    kin
    kin is offline
    New Coder
    Join Date
    Jul 2011
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VIPStephan View Post
    It depends on what you’re up to.
    Quote Originally Posted by tempz View Post
    He means, what are you going to use it for?

    • Resize your website on the resolution the user has;
    • Display there screen size and ask them to change it.
    • Change elements/div in your website on a curtain resolution.


    :P
    Ah sorry, well I am trying to position a post entry button so that it's slighly offset from the main news location. No matter what I have tried, relative positioning, margins, and even a new div just for that button seem not to work correctly on different screen resolutions. I also want to know just how to position something so that it stays in that position just to use it for future reference.



    Also, what's better to size a div, percentages or pixels, why?
    Last edited by kin; 07-31-2012 at 05:17 AM. Reason: 2 questions.

  • #7
    Regular Coder
    Join Date
    Jul 2012
    Location
    London
    Posts
    473
    Thanks
    4
    Thanked 86 Times in 86 Posts
    Quote Originally Posted by kin View Post
    Ah sorry, well I am trying to position a post entry button so that it's slighly offset from the main news location. No matter what I have tried, relative positioning, margins, and even a new div just for that button seem not to work correctly on different screen resolutions. I also want to know just how to position something so that it stays in that position just to use it for future reference.
    You want to position a button but able to move it freely? Do you want to be a fixed position that when the user scrolls it follows him? Or when the user scrolls it doesn't move.

    None moving, when user is scrolling.
    CSS
    Code:
    .mydiv {
    
    position:relative; top:0; /* You would use these to move the button using em, pt, % or px. */ left:0; right:0; bottom:0;
    }
    Moving following the user
    CSS
    Code:
    .mydiv {
    
    position:fixed; top:0; /* You would use these to move the button using em, pt, % or px. */ left:0; right:0; bottom:0;
    }
    I'm not sure if this is what you mean, but the way you described it is what I did above.

  • #8
    kin
    kin is offline
    New Coder
    Join Date
    Jul 2011
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tempz View Post
    You want to position a button but able to move it freely? Do you want to be a fixed position that when the user scrolls it follows him? Or when the user scrolls it doesn't move.

    None moving, when user is scrolling.
    CSS
    Code:
    .mydiv {
    
    position:relative; top:0; /* You would use these to move the button using em, pt, % or px. */ left:0; right:0; bottom:0;
    }
    Moving following the user
    CSS
    Code:
    .mydiv {
    
    position:fixed; top:0; /* You would use these to move the button using em, pt, % or px. */ left:0; right:0; bottom:0;
    }
    I'm not sure if this is what you mean, but the way you described it is what I did above.
    It's so that the button stays where it is when the user scrolls. Does position relative take in consideration of the viewport size?

  • #9
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,925
    Thanks
    6
    Thanked 1,040 Times in 1,013 Posts
    Quote Originally Posted by kin View Post
    Whatcha mean?
    What I meant by saying “It depends on what you’re up to” is that we can’t give you any specific advice without seeing your code or knowing what kind of layout you wanna have, or for what reason you want screen size based positioning, respectively. Give us more context and we’ll find a way.

    Quote Originally Posted by kin View Post
    There's that thread of mine I was looking for haha. I knew I posted it a while back but could not find it. I am a newb with vbulletin forums.
    You can find all threads you have ever posted here by clicking your user name at the left and then clicking the according link in the user statistics. Alternatively you can click the link “User CP” in the top left corner of the page and “Your Profile” in the left menu.

  • #10
    kin
    kin is offline
    New Coder
    Join Date
    Jul 2011
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VIPStephan View Post
    What I meant by saying “It depends on what you’re up to” is that we can’t give you any specific advice without seeing your code or knowing what kind of layout you wanna have, or for what reason you want screen size based positioning, respectively. Give us more context and we’ll find a way.



    You can find all threads you have ever posted here by clicking your user name at the left and then clicking the according link in the user statistics. Alternatively you can click the link “User CP” in the top left corner of the page and “Your Profile” in the left menu.
    Alrighty thanks, I fixed this issue late last night. Just created a separate div then used positioning for it. It worked on every browser and screen size I used.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •