Stránka: 1 z 1
| [ Príspevkov: 16 ] | |
Autor | Správa |
---|
Registrovaný: 07.08.06 Prihlásený: 18.11.21 Príspevky: 947 Témy: 268 | 268 Bydlisko: Levice |
Mam malicky problem - mam horizontalne menu vertikalne centrovane. Vo vsetkych browseroch je to vycentrovane /FF, IE6, IE7, Chrome, Safari,atd.../ okrem Opery. Tam je to menu posunute o par pixelov vyssie. Potrebujem zvlast padding pre Operu. Da sa to nejako zapisat v html?
Pre IE6 som zvykol takto: Kód: <!--[if lt IE 7.]> <style> .menu {padding-top:15px;} </style> <![endif]-->
Takto to pekne funguje, ale da sa taketo nieco aj pre Operu?
|
|
Registrovaný: 24.01.08 Prihlásený: 13.09.17 Príspevky: 14572 Témy: 66 | 66 Bydlisko: Žilina |
nie
_________________ C#, PHP, ... |
|
Registrovaný: 07.08.06 Prihlásený: 18.11.21 Príspevky: 947 Témy: 268 | 268 Bydlisko: Levice |
Hm, tak by ste mi vedeli poradit, ako vertikalne vycentrovat horizontalne menu bez toho, aby som pouzil padding-top?
CSS: Kód: .menu {text-align: center; margin-top: 0px;padding-top: 0px; background-color: #C0C0C0;height: 40px;vertical-align: middle;}
ul {margin: 0;list-style-type: none;} li {display: inline;margin: 0;padding: 0;}
.pad {padding-left: 2.6em;}
li a{font-size: 12px; text-decoration: none; color: white;font-weight: bold; } li a:hover{font-size: 12px; color: black;font-weight: bold; } li span a{font-size: 12px; color: black;font-weight: bold; } </style> ak pridam do ul {... padding-top:10px;}, tak to bude v strede, ale v Opere to je posunute vyssie. HTML: Kód: <div class="menu"> <ul> <li class="pad"><span><a href="">MENU</a></span></li> <li class="pad"><a href="">MENU</a></li> <li class="pad"><a href="">MENU</a></li> <li class="pad"><a href="">MENU</a></li> <li class="pad"><a href="">MENU</a></li> <li class="pad"><a href="">MENU</a></li> <li class="pad"><a href="">MENU</a></li> <li class="pad"><a href="">MENU</a></li> </ul> </div>
|
|
Registrovaný: 02.12.07 Prihlásený: 26.02.13 Príspevky: 1114 Témy: 49 | 49 |
ked neces pouzit padding tak pouzi margin.. preco to vlastne nechces pouzit?
|
|
Registrovaný: 07.08.06 Prihlásený: 18.11.21 Príspevky: 947 Témy: 268 | 268 Bydlisko: Levice |
ved pisem jasne preco to nechcem pouzit: ked pouzijem padding alebo margin top, tak vsade to pomoze, ale v OPERE to zostane posunute vyssie a NIE v strede! Od zaciatku temy to pisem, ved to je ten problem. Precitaj si lepsie prispevky.
Niekto by pripadne vedel pomoct?
|
|
Registrovaný: 01.10.07 Prihlásený: 03.02.14 Príspevky: 747 Témy: 152 | 152 Bydlisko: Bratislava | |
Registrovaný: 07.08.06 Prihlásený: 18.11.21 Príspevky: 947 Témy: 268 | 268 Bydlisko: Levice |
No ja som skusil toto: <link rel="stylesheet" type="text/opera" href="styleo.css" />
ale zda sa ze Opera to veselo ignoruje, takze to nepomaha.
Neviem preco, ale Opera sa mi nezdala uz od zaciatku. Este aj na IE6 viem lahsie optimalizovat web ako na Operu. Ked vsade vsetko sedi, tak v Opere nie. /cest vynimkam/.
|
|
Registrovaný: 03.04.08 Prihlásený: 10.12.19 Príspevky: 4667 Témy: 37 | 37 Bydlisko: Trnava |
skontroluj ci mas spravne zapisany doctype... preco miesas jednotky px a em a pri hodnotach zadavaj aj jednotky nie iba 0 ....skus posunut cely div a nie iba ul padding top nepouzivaj skor margin...a
_________________ Hmmm .... Hrošíček ... [Homer] |
|
Registrovaný: 24.01.08 Prihlásený: 13.09.17 Príspevky: 14572 Témy: 66 | 66 Bydlisko: Žilina |
don jebot, a také, že keď máš nulovú hodnotu, jednotky písať je totálna zbytočnosť, si ešte nepočul ?
_________________ C#, PHP, ... |
|
Registrovaný: 27.07.07 Príspevky: 3948 Témy: 51 | 51 Bydlisko: Bratislava |
>neopagan: cez absolutne pozicovanie si to skusal?
_________________ NTB: Acer Aspire 4820TG 14" | CPU: Intel Core i5 2,53 GHz | VGA: ATI Mobility Radeon HD5650 1GB | RAM: 8GB DDR3 1066 MHz | HDD: 1TB SSD WD BLUE |
|
Registrovaný: 07.08.06 Prihlásený: 18.11.21 Príspevky: 947 Témy: 268 | 268 Bydlisko: Levice |
myslis ze .menu pridam relativnu a ul absolutnu poziciu? Ziadna zmena. V opere je to stale asi o 3-4 pixely vyssie
|
|
Registrovaný: 27.07.07 Príspevky: 3948 Témy: 51 | 51 Bydlisko: Bratislava |
ano, presne tak som to myslel, skus tento kod:
CSS:
Kód: * { margin:0; padding:0; border:0; } #menu { position:relative; height:40px; background:#cecece; word-spacing:20px; } #menu ul { position:absolute; height:20px; list-style:none; top:50%; margin-top:-10px; } #menu ul li { display:inline; } HTML: Kód: <div id="menu"> <ul> <li><span><a href="">MENU</a></span></li> <li><a href="">MENU</a></li> <li><a href="">MENU</a></li> <li><a href="">MENU</a></li> <li><a href="">MENU</a></li> <li><a href="">MENU</a></li> <li><a href="">MENU</a></li> <li><a href="">MENU</a></li> </ul> </div>
_________________ NTB: Acer Aspire 4820TG 14" | CPU: Intel Core i5 2,53 GHz | VGA: ATI Mobility Radeon HD5650 1GB | RAM: 8GB DDR3 1066 MHz | HDD: 1TB SSD WD BLUE |
|
Registrovaný: 07.08.06 Prihlásený: 18.11.21 Príspevky: 947 Témy: 268 | 268 Bydlisko: Levice |
tento kod stenley funguje dobre, ked ho nahodim do prazdneho html. Ked ho pouzijem v mojom kode, je tam este stale rozdiel asi 2px. Takze to sposobuje asi nieco ine. Ked to nastavim v Opere dobre, vo FF je to posunute, a opacne. Ale nevadi, tie 2px nie je taky problem.
|
|
Registrovaný: 27.07.07 Príspevky: 3948 Témy: 51 | 51 Bydlisko: Bratislava |
ked si s tym nebudes vediet rady, tak postni kod a pozrieme sa na to...
_________________ NTB: Acer Aspire 4820TG 14" | CPU: Intel Core i5 2,53 GHz | VGA: ATI Mobility Radeon HD5650 1GB | RAM: 8GB DDR3 1066 MHz | HDD: 1TB SSD WD BLUE |
|
Registrovaný: 17.10.06 Prihlásený: 08.01.11 Príspevky: 1752 Témy: 17 | 17 |
ten rozdiel bude sposobovat pravdepodobne margin ineho prvku. skus dat na zaciatok * {margin:0; padding:0;} ci ta 2px medzera zmizne. tak sa mi zda, ze rozne prehliadace maju pre niektore prvky defaultne nastavene ine odsadenie.
_________________ A Real Programmer might or might not know his wife's name. He does, however, know the entire ASCII code table. |
|
Registrovaný: 07.08.06 Prihlásený: 18.11.21 Príspevky: 947 Témy: 268 | 268 Bydlisko: Levice |
nepomohol ani ten margin. No tak nahodim tu povodnu cast mojho kodu.
stenley: word-spacing nemozem pouzit, kedze mam aj dvojslovne polozky menu... ale to je teraz jedno.
CSS: Kód: body {font-family: verdana, tahoma, arial, san-serif; background-image: url(images/bg.jpg); background-repeat: repeat-x; background-position: top; padding: 0;margin: 0;}
img {border: 0;}
#container {width: 990px; margin-left: auto; margin-right: auto; }
div#header { width:100%; height:150px; text-align: left; background-image: url(images/top.jpg); background-repeat: no-repeat; background-position: top center; position: relative;}
.top {height: 91px; width: 100%;} .reklama1{vertical-align: top; margin-top: 21px; margin-left: 17px;position: absolute;}
.menu {text-align: center; margin-top: 0px;padding-top: 0px;}
ul {margin: 0;padding-top:18px;list-style-type: none;} li {display: inline;margin: 0;padding: 0;}
.pad {padding-left: 2.6em;} .pad1 {margin-left: -2.5em;}
li a{font-size: 12px; text-decoration: none; color: white;font-weight: bold; } li a:hover{font-size: 12px; color: black;font-weight: bold; } li span a{font-size: 12px; color: black;font-weight: bold; }
HTML: Kód: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cz" lang="cz" > <head> <title>Trh pudy </title> <meta http-equiv="content-type" content="text/html;charset=windows-1250" /> <link rel="stylesheet" type="text/css" href="style2.css" /> </head> <!--[if lt IE 8.]> <style> .pad1 {margin-left: 0;} .pad {padding-left: 2.7em;} </style> <![endif]--> <body> <div id="container"> <div id="header"> <div class="top"> <a href="#"> <img src="images/logo.jpg" alt="logo" width="256" height="91" /></a> <a href="#"> <img src="images/reklamatop.jpg" width="468" height="60" class="reklama1" alt="banner"/></a> </div> <div class="menu"> <ul> <li class="pad1"> <span> <a href="">DOMÁCÍ TRH</a> </span></li> <li class="pad"> <a href="">CENA PŮDY</a></li> <li class="pad"> <a href="">TRH EU</a></li> <li class="pad"> <a href="">NABÍDKA PŮDY</a></li> <li class="pad"> <a href="">POPTÁVKA PŮDY</a></li> <li class="pad"> <a href="">ČLÁNKY</a></li> <li class="pad"> <a href="">SVĚTOVÉ TRHY</a></li> <li class="pad"> <a href="">O NÁS</a></li> </ul> </div> </div> </div>
na zivo je to tu: www.inbazar.sk/skuska/index2.html
|
|
Stránka: 1 z 1
| [ Príspevkov: 16 ] | |
Podobné témy | Témy | Odpovede | Zobrazenia | Posledný príspevok |
---|
 | v HTML, XHTML, XML, CSS | 13 | 1190 | 15.01.2009 19:19 dsljohn |  | v HTML, XHTML, XML, CSS | 4 | 674 | 23.01.2009 23:52 dedko45 |  | v Sieťové a internetové programy | 2 | 422 | 27.07.2012 16:56 mtxd |  | v HTML, XHTML, XML, CSS | 10 | 871 | 06.06.2011 20:03 Psycho |  | v HTML, XHTML, XML, CSS | 10 | 729 | 22.05.2008 18:29 Svolo |  | v HTML, XHTML, XML, CSS | 9 | 603 | 23.11.2008 22:05 shaggy |  | v HTML, XHTML, XML, CSS | 2 | 403 | 08.03.2012 18:46 BlackB |  | v HTML, XHTML, XML, CSS | 4 | 401 | 13.03.2010 16:20 Unlink |  | v HTML, XHTML, XML, CSS | 1 | 566 | 02.02.2008 20:07 emer |  | v HTML, XHTML, XML, CSS | 13 | 1172 | 03.04.2009 10:12 Flety |  | v Webdesign | 2 | 928 | 16.02.2008 12:51 imnotwhafo |  | v HTML, XHTML, XML, CSS | 13 | 797 | 01.02.2008 22:30 pitrik1 |  | v Externé zariadenia | 18 | 833 | 12.03.2012 19:41 Spirit of the Hawk |  | v HTML, XHTML, XML, CSS | 9 | 826 | 02.04.2011 15:50 camo |  | v Sieťové a internetové programy | 17 | 1116 | 04.01.2007 14:28 exot |  | v HTML, XHTML, XML, CSS | 6 | 565 | 20.12.2009 18:18 petanorech |
|