treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Need Help Positioning div

  • hello, please help me with positioning this div http://jsfiddle.net/DnJ2z/95/ check the link above When we scroll down the blue div in html a div appears in green color. I need help in positioning that div that for different screen sizes it should remain at its fixed position which it is currently on When we zoom out it starts moving on right side :(

    I want it from the right of the screen upto some position in center(say near word Hello) and If we zoom out it should remain on that position(near word Hello as before)

    :HELP:

  • I'm a little confused about what you want to do but you could try setting widths of the blue/green divs to percentages

  • I am also slightly confused as to what you want, but if you are concerned about the position of the div with an ID of dvid at smaller breakpoints, I would simply change the property value to something that isn't as wide as 200px. The reason you want a value that is less than the current pixel value is because 200px on a device that is, say, 480px wide (e.g., an iPhone Droid), is going to appear much larger than you want. This would also affect your perception of its position within the viewport. Using percentages is one easy way to eschew much of this headache.

    But, again, I am slightly uncertain as to what you want.