V
V
vgrayster2011-11-12 08:53:09
css
vgrayster, 2011-11-12 08:53:09

Align DIV to top

I usually manage somehow on my own, but I've been sitting here for an hour now and I can't figure out how to solve the problem.

There is a code Now the Right line is displayed opposite the Line2 line, but how to make the floating div "stick" to the top edge and the contents of this div are displayed opposite the line Line1?
Line 1

Line2

RightLine



Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
mrspd, 2011-11-12
@mrspd

Put RightLine first and make it float: right

M
mark_ablov, 2011-11-12
@mark_ablov

Wrap Line1/Line2 in float: left div?

D
Desiderata, 2011-11-12
@Desiderata

Perhaps moving the RightLine block to the beginning would be the most correct solution.
In case the problem needs to be solved in pure CSS:

<div style="width:300px;position:relative;">
Line 1

Line2

<div style="position:absolute;top:0;right:0;"> RightLine </div>
</div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question