Hej
CSS har aldrig interesseret mig vildt meget og har ik sat mig super meget ind i det,
men ville mene man skulle kunne centere indholdet af en div på den her måde, men kan ik få det til at virke, nogen der kan give mig et hint hvordan jeg kommer vidre =)
- <div class="clearfix w240 table" style="border: 1px solid red;">
- <div class="left w94 middle" style="border: 1px solid green;">vertical centering??</div>
- <div class="right w94">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.</div>
- </div>
- .w94{
- width: 94px;
- }
- .w240{
- width: 240px;
- }
- .table{
- display: table;
- }
- .middle{
- display: table-cell;
- vertical-align: middle;
- }
- .left{
- float: left;
- }
- .right{
- float: right;
- }
edit:
er kommet frem til det er pga min float, men hvordan kan opnå det med float og centering?
Indlæg senest redigeret d. 28.02.2012 14:04 af Bruger #3427