Navigační menu na CSS3.

 2012-01-27 00:00:00
 Dmitry Burobin

Navigační menu je jedním z důležitých prvku každého webu. V daném článku vytvoříme atraktivní menu na CSS3.

Ukázka!

css_menu

HTML

Označení pro menu je poměrně jednoduché a vyskituje se prvek HTML5 tag nav:

<nav>
    <
ul>
        <
li><a href="">Hlavní</a></li>
        <
li><a href="">Kategorie</a></li>
        <
li><a href="">O nás</a></li>                
        <
li><a href="">Portfolio</a></li>
        <
li><a href="">Kontakt</a></li>
    </
ul>
</
nav>

CSS


nav  {
    
displayblock;
    
width100%;
    
overflowhidden;
}

nav ul {
    
margin80px 0 20px 0;
    
padding.7em;
    
floatleft;
    list-
stylenone;
    
background#444;
    
backgroundrgba(0,0,0,.2);
    -
moz-border-radius.5em;
    -
webkit-border-radius.5em;
    
border-radius.5em;    
    -
moz-box-shadow0 1px 0 rgba(255,255,255,.2), 
0 2px 1px rgba(0,0,0,.8inset;
    -
webkit-box-shadow0 1px 0 rgba(255,255,255,.2), 
0 2px 1px rgba(0,0,0,.8inset;
    
box-shadow0 1px 0 rgba(255,255,255,.2), 
0 2px 1px rgba(0,0,0,.8inset
}

nav li {
    
float:left;
}

nav a {
    
float:left;
    
padding.8em 1.5em;
    
text-decorationnone;
    
color#555;
    
text-shadow0 1px 0 rgba(255,255,255,.5);
    
fontbold 1.1em/'trebuchet MS'ArialHelvetica;
    
letter-spacing1px;
    
text-transformuppercase;
    
border-width1px;
    
border-stylesolid;
    
border-color#fff #ccc #999 #eee;
    
background#c1c1c1;
    /*Gradient pozadí*/
    
background: -moz-linear-gradient(#f5f5f5, #c1c1c1);
    
background: -webkit-gradient(linearleft topleft bottom
from(#f5f5f5), to(#c1c1c1));
    
background: -webkit-linear-gradient(#f5f5f5, #c1c1c1);
    
background: -o-linear-gradient(#f5f5f5, #c1c1c1);
    
background: -ms-linear-gradient(#f5f5f5, #c1c1c1);
    
backgroundlinear-gradient(#f5f5f5, #c1c1c1);            
 
}
 
nav a:hovernav a:focus {
    
outline0;
    
color#fff;
    
text-shadow0 1px 0 rgba(0,0,0,.2);
    
background#fac754;
    /*Gradient pozadí*/
    
background: -moz-linear-gradient(#fac754, #f8ac00);
    
background: -webkit-gradient(linearleft topleft bottom
from(#fac754), to(#f8ac00));
    
background: -webkit-linear-gradient(#fac754, #f8ac00);
    
background: -o-linear-gradient(#fac754, #f8ac00);
    
background: -ms-linear-gradient(#fac754, #f8ac00);
    
backgroundlinear-gradient(#fac754, #f8ac00);
}

nav a:active {
    
/*Odstíny*/
    
-moz-box-shadow0 0 2px 2px rgba(0,0,0,.3inset;
    -
webkit-box-shadow0 0 2px 2px rgba(0,0,0,.3inset;
    
box-shadow0 0 2px 2px rgba(0,0,0,.3inset;
}
 
nav li:first-child a {
    
border-left0;
    
/*Zaokrouhlení*/
    
-moz-border-radius4px 0 0 4px;
    -
webkit-border-radius4px 0 0 4px;
    
border-radius4px 0 0 4px;            
}

nav li:last-child a {
    
border-right0;
    
/*Zaokrouhlení*/
    
-moz-border-radius0 4px 4px 0;
    -
webkit-border-radius0 4px 4px 0;
    
border-radius0 4px 4px 0;            
}

Výsledek

css_menu

Podpora prohlížečů.

Menu by mělo fungovat ve všech prohlížečích. Ve starých verzích se odpojí některé vizualní efekty, ale to by němělo ovlivnit funkčnost.
css_menu

Zdroj: www.red-team-design.com/cool-css3-navigation-menu

Systém Orphus
Napište komentář.
Celkem komenrářů(39)
Michaelbeege - 2018-07-30  00:17:45
 india kamagra 100mg chewable tablets
[url=https://www.kamagrajellyk.com/]buy kamagra oral jelly[/url]
kamagra 100mg chewables
kamagra oral jelly
kamagra forum
Charlesmah - 2018-07-17  18:03:13
 cialis vs viagra user reviews
generic viagra
price of generic viagra at walgreens
[url=http://viagrapipls.com/]viagra generic[/url]
natural viagra foods india
http://viagrapipls.com/
generic name for viagra joke
Robertevodo - 2018-07-17  11:09:55
 kamagra uk next day
[url=https://www.kamagrapos.com/]kamagra[/url]
kamagra oral jelly kaufen wien
buy kamagra
kamagra oral jelly how to use
DavidTix - 2018-07-12  23:18:26
 kamagra jelly paypal
kamagra oral jelly
kamagra kopen rotterdam
[url=https://www.kamagrajellyk.com/]kamagra jelly[/url]
kamagra oral jelly for sale in usa il
Buy kamagra - 2018-03-30  03:36:22
 kamagra novi sad potencija
[url=http://kamagradxt.com/]kamagra oral jelly cvs[/url]
kamagra kopen in winkel rotterdam
kamagra 100mg oral jelly
kamagra oral jelly online kaufen paypal
http://kamagradxt.com/
kamagra shop deutschland test
JustSugs - 2017-12-23  20:48:53
 Cheap Cialis Online Canadian P [url=http://costofcial.com]cialis[/url] Dose Of Amoxicillin For Sinus Infection Propecia Galenico 247 Ove
ight Pharmacy Canadian Propecia Componentes cialis Fml Bentyl 20mg Byclomine Muscle Spasms Cephalexin Tanning http://costofcial.com - cialis Acheter Viagra Andorre Order Alli Viagra Online Rezeptfrei
Haroreab - 2017-12-06  12:19:03
 Best Viagra Prices 100mg Dose Of Amoxicillin [url=http://cheapvia50mg.com]viagra online prescription[/url] Gentamicin Cheap Nexium Online No Prescription Can Buy Colchicine 0 5 At Store
Jeffpoonia - 2017-12-03  23:44:38
 Baclofene Duree Traitement How Do You Spell Keflex [url=http://cialgeneri.com ]cialis[/url] Cialis Sans Ordonance
Jeffpoonia - 2017-12-03  23:44:35
 Baclofene Duree Traitement How Do You Spell Keflex [url=http://cialgeneri.com ]cialis[/url] Cialis Sans Ordonance
Haroreab - 2017-11-29  11:47:13
 Levitra Ove
ight Delivery Niazagra Online [url=http://sildenafdosage.com]viagra online pharmacy[/url] Combitic Global Caplet Levitra Decret
Haroreab - 2017-11-29  11:47:10
 Levitra Ove
ight Delivery Niazagra Online [url=http://sildenafdosage.com]viagra online pharmacy[/url] Combitic Global Caplet Levitra Decret
Haroreab - 2017-11-29  11:47:09
 Levitra Ove
ight Delivery Niazagra Online [url=http://sildenafdosage.com]viagra online pharmacy[/url] Combitic Global Caplet Levitra Decret
Haroreab - 2017-11-29  11:47:08
 Levitra Ove
ight Delivery Niazagra Online [url=http://sildenafdosage.com]viagra online pharmacy[/url] Combitic Global Caplet Levitra Decret
Haroreab - 2017-11-12  15:29:41
 Medrol Dose Pack No Prescription Cialis Generika Kaufen Rezeptfrei [url=http://orderviapills.com]viagra[/url] Amoxicillin Different Penecillin Seroquel
Haroreab - 2017-11-12  15:29:40
 Medrol Dose Pack No Prescription Cialis Generika Kaufen Rezeptfrei [url=http://orderviapills.com]viagra[/url] Amoxicillin Different Penecillin Seroquel
Haroreab - 2017-11-12  15:29:39
 Medrol Dose Pack No Prescription Cialis Generika Kaufen Rezeptfrei [url=http://orderviapills.com]viagra[/url] Amoxicillin Different Penecillin Seroquel
Haroreab - 2017-11-12  15:29:37
 Medrol Dose Pack No Prescription Cialis Generika Kaufen Rezeptfrei [url=http://orderviapills.com]viagra[/url] Amoxicillin Different Penecillin Seroquel
Haroreab - 2017-10-30  13:15:10
 How To Buy Shipped Ups Generic Progesterone 200mg Website [url=http://howtogetvia.com]viagra[/url] Foro Priligy Espana 500mg Lasix No Prescription Kwikmed
Haroreab - 2017-10-30  13:15:09
 How To Buy Shipped Ups Generic Progesterone 200mg Website [url=http://howtogetvia.com]viagra[/url] Foro Priligy Espana 500mg Lasix No Prescription Kwikmed
Haroreab - 2017-10-27  12:11:36
 Actu Viagra Medicament [url=http://cheapviafast.com]viagra[/url] Ceallas And Viag For Sale Ward Capsule Levitra Gratuit
[1] [2] 
*v komentářich nesmíte používat sprostá slova a odkazy!!!Děkuji za pochopeni.