Home › Forums › CSS › Simple float div question › Reply To: Simple float div question
November 29, 2013 at 10:22 am
#157403
Merri
Participant
Give it position: fixed;
and use right: 0;
to set it to rightmost edge. You can also set other values like 10px to move it left.
This does not float it right, but positions it to right. When you use position absolute, relative or fixed you can use left, top, right and bottom to move the element. You can also resize the element by giving both left and right or bottom and top.
For example:
.element {
background: red;
position: fixed;
bottom: 0;
top: 0;
left: 0;
right: 0;
}
Now .element
covers the whole viewport (visible screen).