trakaissk Posted March 30, 2010 Report Share Posted March 30, 2010 (edited) Sveiki ir sekojoša problēma vajag mājas lapu nolikt pa centru neizmantojot html bet gan divu. Sadi neder <div align='center'></div> vai ir kautkāda iespēja css to visu nolikt pa centu neizmantojot tabulas,es zinu kad ir , bet nezinu kā to izdarīt. Bet neizmantojot tik un tik px no labas puses vai no kreisas vajag tiesi pa centru. Jau laikus paldies. Edited March 30, 2010 by trakaissk Quote Link to comment Share on other sites More sharing options...
2easy Posted March 30, 2010 Report Share Posted March 30, 2010 margin: auto; width: 800px Quote Link to comment Share on other sites More sharing options...
trakaissk Posted March 30, 2010 Author Report Share Posted March 30, 2010 margin: auto; width: 800px A height nav jaizmanto tikai width Quote Link to comment Share on other sites More sharing options...
2easy Posted March 30, 2010 Report Share Posted March 30, 2010 (edited) priekš centrēšanas ar margin:auto pietiek ar width (nju tas ir arī nepieciešams) un sākumā doctype arī laikam bija vēlams. tipa lai ir valid xhtml (transitional/strict) vispār jau nu jautājumus vispirms ir jāprasa googlei (to jau visi saka) ieraksti "div center" un jau pirmais rezultāts ir ņemams Edited March 30, 2010 by 2easy Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted March 30, 2010 Report Share Posted March 30, 2010 transitional/strict is the past - HTML5 is the future ^_^ Quote Link to comment Share on other sites More sharing options...
2easy Posted March 30, 2010 Report Share Posted March 30, 2010 future ir HTML 123123123 Quote Link to comment Share on other sites More sharing options...
trakaissk Posted March 30, 2010 Author Report Share Posted March 30, 2010 Hmm tas man ir jaliek tiesi taja div ko es gribu nolikt pa centru vai body. Quote Link to comment Share on other sites More sharing options...
mefisto Posted March 30, 2010 Report Share Posted March 30, 2010 Lasi : http://htmldog.com/guides/cssbeginner/applyingcss/ Ja arī tad nepielec , tad maini hobiju , piemēram, sāc profesionāli audzēt1 redīsus Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted March 30, 2010 Report Share Posted March 30, 2010 (edited) <!DOCTYPE html> <html> <head> <title>HTML5 FTW</title> <style type="text/css"> #wrapper { width:500px; border-left:1px solid black; border-right:1px solid black; margin:0px auto; } </style> </head> <body> <div id="wrapper"> OMG šis ir centrēts div </div> </body> </html> Edited March 30, 2010 by rATRIJS Quote Link to comment Share on other sites More sharing options...
2easy Posted March 30, 2010 Report Share Posted March 30, 2010 taisni anekdote sanāk. čuvaks grib iecentrēt ar css, bet nezin, kur vsp ir jāraksta css :D:D:D no comment Quote Link to comment Share on other sites More sharing options...
trakaissk Posted March 30, 2010 Author Report Share Posted March 30, 2010 Liels paldies. Quote Link to comment Share on other sites More sharing options...
sandis_m Posted March 30, 2010 Report Share Posted March 30, 2010 Ja arī tad nepielec , tad maini hobiju , piemēram, sāc profesionāli audzēt1 redīsus Labs :D Quote Link to comment Share on other sites More sharing options...
trakaissk Posted March 30, 2010 Author Report Share Posted March 30, 2010 taisni anekdote sanāk. čuvaks grib iecentrēt ar css, bet nezin, kur vsp ir jāraksta css :D:D:D no comment Reali es zinu kur ir jaliek css nevajag jau sakt spamot un apsaukat. Es biju domajis vai katram manam veidotajam divam ir tas jaliek vai es vnk varu pielikt visu pie <body style=" margin:0px auto; width:500px;"> un vis iet pa cetru. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted March 30, 2010 Report Share Posted March 30, 2010 Nu kā, 2easy ir "Spama meistars"!!! Cik var atkārtot! :@ Tu uzliec tam div'am (vai div'iem) kurus vēlies iecentrēt klasi, piemēram 'foo'... :D To dara šādi... <div class='foo'></div> ...vai... <div class='foo'></div> <div class='foo'></div> <div class='foo'></div> Tad CSS failā šai klasei pieliec vērtības... div.foo { margin: 0 auto; width: 960px; } Un izmanto semantiskus nosaukumus, nevis 'foo'! :D Quote Link to comment Share on other sites More sharing options...
2easy Posted March 30, 2010 Report Share Posted March 30, 2010 yep, speciāli uzliku tādu "title", lai tauta vieglāk pārcieš manus uzbraucienus... :D:D:D jā, un tas css attiecas uz konkrēto div. vnk tā kā tur bez tava div taga nekā cita nebija, tad nesāku barot ar karotīti ;) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.