andrisp Posted March 6, 2006 Report Share Posted March 6, 2006 <div style="border: 1px solid orange;"> <div style="float: left; ">Left</div> <div style="float: right; ">Right</div> </div> Lieta tāda, ka ietverošais DIV saplacinās, un iekšējie DIVi izlien ārpus tā. Kāpēc tā ? Ko lai dara, lai tā nebūtu ? Link to comment Share on other sites More sharing options...
bubu Posted March 6, 2006 Report Share Posted March 6, 2006 Laikam šitā varēja: <div style="border: 1px solid orange;"> <div style="float: left; ">Left</div> <div style="float: right; ">Right</div> <div style="float: clear;"></div> </div> Link to comment Share on other sites More sharing options...
hmnc Posted March 6, 2006 Report Share Posted March 6, 2006 ja negribi vairs floatēt tad pēc visiem floatiem iemet: <div style="clear:both;"></div> Link to comment Share on other sites More sharing options...
bubu Posted March 6, 2006 Report Share Posted March 6, 2006 Ui sorry, kautkādu sviestu uzrakstīju :D Gribēju kā hmnc parādīja, tb clear:both mana float:clear vietā! Link to comment Share on other sites More sharing options...
andrisp Posted March 6, 2006 Author Report Share Posted March 6, 2006 Šo variantu es arī vienmēr izmantoju, bet man nepatīk šādi. Bet kautkā neliekas semantiski vai kautkā tā.. Link to comment Share on other sites More sharing options...
hmnc Posted March 6, 2006 Report Share Posted March 6, 2006 nu a ko darīt.. tāda dzīve - citādāk, cik man zināms, notīrīt floatingu nevar (bez papildus tegiem). skaistums prasa upurus :) Link to comment Share on other sites More sharing options...
eglitis Posted March 7, 2006 Report Share Posted March 7, 2006 (edited) .lielsdivs:after { content: "-"; display: block; height: 0; clear: both; visibility: hidden; } Par pašu pieeju: http://www.positioniseverything.net/easyclearing.html Edited March 7, 2006 by eglitis Link to comment Share on other sites More sharing options...
bubu Posted March 7, 2006 Report Share Posted March 7, 2006 :after taču nestrādā zem IE. Link to comment Share on other sites More sharing options...
andrisp Posted March 7, 2006 Author Report Share Posted March 7, 2006 Tur pat iekš tā linka bija teikts, ka vajag arī /* Hides from IE-mac \*/ * html .clearfix {height: 1%;} /* End hide from IE-mac */ Un tad laikam būs ok arī iekš IE. Link to comment Share on other sites More sharing options...
eglitis Posted March 7, 2006 Report Share Posted March 7, 2006 :after nestrādā iekš IE, bet IE child elementus korekti saliek parent divā arī tāpat (vai kļūdos?). Link to comment Share on other sites More sharing options...
hmnc Posted March 7, 2006 Report Share Posted March 7, 2006 a nafig taisīt kkādus hackus, ja visu var realizēt bez ūber krutām 21.gadsimta metodēm? imo kodam jābūt tādam, lai viņš normāli rādītos korekti maksimāli daudz dažādos browseros bez visādiem hackiem un custom stiliem katram browserim atsevišķi. Link to comment Share on other sites More sharing options...
eglitis Posted March 7, 2006 Report Share Posted March 7, 2006 Bet jaunās tehnoloģijas var un vajag izmantot, lai programmēšana nepārvēršas par rutīnu :) Link to comment Share on other sites More sharing options...
hmnc Posted March 7, 2006 Report Share Posted March 7, 2006 jaunās tehnoloģijas var un vajag izmantot tikai tad, kad esi pārliecināts, ka tās strādās uz vismaz 95% lietotāju datoriem. Link to comment Share on other sites More sharing options...
R21vo Posted March 8, 2006 Report Share Posted March 8, 2006 izmantoju clear:both metodi, nafig sarežģīt dzīvi ar hackiem? Labāk nesemantisks saturs, nekā nevalīds kods. Link to comment Share on other sites More sharing options...
Recommended Posts