parastsLietotajs Posted June 25, 2008 Report Share Posted June 25, 2008 cau xHTML strict kaa piedabuut bildi ieksh <div> elementa pa vidu? text-align = horizontaali kaa ir vertikaali? [atkaartoshos - xHTML strict] iekš Opera un FF strādā šis piemērs: http://www.webtoolkit.info/css-vertical-align.html uz IE, brīnums, bet nestrādā pareizi :) man jau itkā pie kājas tas IE, bet tā nebūtu smuki reku bildīši FireFox IE un kods html <div class="banner_top"> <div class="v-middle"> <div class="v-inner"> <img src="http://sfx-images.mozilla.org/affiliates/Buttons/firefox3/468x60.png" /> </div> </div> </div> css .banner_top { width: 830px; height: 100px; border-left: 1px solid black; border-right: 1px solid black; float: right; text-align: center; background-color: #d3d3d3; display: table; #position: relative; overflow: hidden; } .v-middle { display: table-cell; #position: absolute; #top: 50%; vertical-align: middle; } .v-inner { #position: relative; #top: -50%; } Link to comment Share on other sites More sharing options...
andrisp Posted June 25, 2008 Report Share Posted June 25, 2008 Tev tai bildei vienmēr būs fiksēts augstums ? Tad labāk izmanto vienkārši margin vai padding, lai vizuāli vertikāli nocentrētu. Mazāk problēmu. Link to comment Share on other sites More sharing options...
parastsLietotajs Posted June 25, 2008 Author Report Share Posted June 25, 2008 nebūs fiksēts izmērs. un itkaa pielaboju .v-middle {display: table-cell; #position: absolute; #top: 50%; #left: 50%; vertical-align: middle; } .v-inner { #position: relative; #top: -50%; #left: -50%; } shaadi uzrakstot izskataas ka stradaa arii uz IE Link to comment Share on other sites More sharing options...
mefisto Posted June 25, 2008 Report Share Posted June 25, 2008 http://innonesen.se/test/l-2/ this should do it. Link to comment Share on other sites More sharing options...
marcis Posted June 26, 2008 Report Share Posted June 26, 2008 Bet vispār saki ko gribi, man izskatās, ka jau pirmā posta abās bildēs, attēls izskatās vertikāli centrēts. Link to comment Share on other sites More sharing options...
Recommended Posts