Issue
I'm trying to position some objects (in this case, are popovers from Bootstrap) and i move them in the space with css utilizing the pixels.
#dot{
top: 60px;
left: 650px
}
I tried also the em, but i was wondering if there is another and more efficient method. Thanks in advance
Solution
I think you can use values relative to viewport width and height. ex : top : 4vh; left : 6vw;
here , 4vh means 4% of viewport height and similarly 6vw means 6% of viewport width.
so if the viewport changes then the positioning will be done according to the new width and height. But make sure that position property is set on the element because for top/left/right/bottom to work, position property must be set on the element.
Answered By - ankit
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.