CSS: move a "float:right" element to top (to align with the first element of the list)
Posted
by Patrick
on Stack Overflow
See other posts from Stack Overflow
or by Patrick
Published on 2010-04-23T11:04:07Z
Indexed on
2010/04/23
12:03 UTC
Read the original article
Hit count: 309
css
hi,
I've a sequence of elements and the last one has css "float:left".
I would like to display it at the same height of the first element and not on the bottom of the list. (I cannot change the html code, so it is the last in the list).
At the same time, I would like to keep it on the right. How can I make it wich CSS ?
thanks
Code:
<div class="field field-type-text field-field-year">
<div class="field-items">
<div class="field-item odd">
<div class="field-label-inline-first">
Year: </div>
2009 </div>
</div>
</div>
<div class="field field-type-text field-field-where">
<div class="field-items">
<div class="field-item odd">
<div class="field-label-inline-first">
Where: </div>
Musée Rath, Geneva </div>
</div>
</div>
<div class="field field-type-text field-field-when">
<div class="field-items">
<div class="field-item odd">
<div class="field-label-inline-first">
When: </div>
25.8 – 27.9.2009 </div>
</div>
</div>
<div class="field field-type-text field-field-editor">
<div class="field-items">
<div class="field-item odd">
<div class="field-label-inline-first">
Editor: </div>
Blabla Blabla </div>
</div>
</div>
<div class="field field-type-text field-field-material">
<div class="field-items">
<div class="field-item odd">
<div class="field-label-inline-first">
Material/techniques: </div>
contemporary art installations </div>
</div>
</div>
<div class="field field-type-text field-field-dimension">
<div class="field-items">
<div class="field-item odd">
<div class="field-label-inline-first">
Dimension: </div>
2 floors in a neoclassical building </div>
</div>
</div>
<div class="field field-type-text field-field-artists">
<div class="field-items">
<div class="field-item odd">
<div class="field-label-inline-first">
Artists: </div>
Blablablabla balbalbalbalba
</div>
</div>
</div>
.field-field-year, .field-field-where, .field-field-when, .field-field-editor, .field-field-material, .field-field-dimension {
width:300px;
}
.field-field-artists {
width:400px;
float:right;
clear:right;
top-margin: -200px;
}
© Stack Overflow or respective owner