magone Posted January 24, 2008 Report Share Posted January 24, 2008 Situācija šāda: menu rindā vajag ievietot izvēlnes, kur katram izvēlnes punktam ir noteikts platums. IE strādā normāli, bet Opera un FF ignorē width. Kā no tā izvairīties? #menu { position:absolute; left:155px; top:117px; font-family:tahoma; width:800px } #menu .divi { width:84px; text-align:center; height:24px; display: inline; } <div id=menu> <span class=divi >Teksts </span> <span class=divi >Teksts </span><span class=divi >Teksts </span> </div> Link to comment Share on other sites More sharing options...
Vebers Posted January 24, 2008 Report Share Posted January 24, 2008 (edited) Span ir inline elements tāpēc, lai viņš neignorētu padding, margin, width utt viņam ir jāuzliek display: block; Bet iesaku veidot menu ar šādu paņēmienu: <ul> <li>viens</li> <li>divi</li> </ul> Edited January 24, 2008 by Vebers Link to comment Share on other sites More sharing options...
mefisto Posted January 24, 2008 Report Share Posted January 24, 2008 vecs piemērs , bet liekas derēs : http://innonesen.se/test/l-19/ Link to comment Share on other sites More sharing options...
magone Posted January 24, 2008 Author Report Share Posted January 24, 2008 Paldies par piemēriem. Mefisto, man vajag, lai menu būtu vienā rindā. Kā to panākt? Link to comment Share on other sites More sharing options...
andrisp Posted January 24, 2008 Report Share Posted January 24, 2008 li elementiem uzliec float: left; un norādit augstumu un platumu. Var arī display: inline likt. http://www.google.com/search?hl=lv&q=css+horizontal+menu Link to comment Share on other sites More sharing options...
magone Posted January 24, 2008 Author Report Share Posted January 24, 2008 Paldies visiem, atradu googlē piemērotu variantu ar <ul> un <li>. Tagad strādā. Link to comment Share on other sites More sharing options...
Recommended Posts