Vous avez une liste de la sorte :
<ul id="menu"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> </ul>
Et vous voulez en faire un menu horizontal, dont les éléments seront répartis équitablement sur toute la largeur de votre bloc conteneur ?
Rien de plus simple, un petit peu de CSS :
ul#menu{
display:table;
}
ul#menu li{
display:table-cell;
text-align:center;
}Et le tour est joué ! ;-)
Commentaires :
# 7-User, le jeudi 19 août 2010 à 21:52:15 # delphiki, le vendredi 20 août 2010 à 12:07:09Quel navigateur ?
Opera 10.60
J'ai la même chose, et ça passe très bien chez moi.
Bien sympa comme astuce.
Merci.
Si la longueur (nombre de caractères) de Item1, 2, 3 et 4 n'est pas la même, l'espace entre chacun des Item va être différent. Comment faire pour que l'espace entre chacun soit la même ?
@Thierry, tu as essayé en fixant les largeurs de tes items ?
ul#menu li{
display:table-cell;
text-align:center;
width:XXpx; /* ta largeur */
}
every
offered
Im really excited about this.. cant wait!
Great site! Thanks for sharing!
great
go thank
thanks
thanks keep going
Great post! Well, if you're looking for a retaining wall builder around Brisbane, book us now! https://brisbaneretainingwalls.net/">High-quality retaining walls in the Brisbane area
Great post! Well, if you're looking for a retaining wall builder around Brisbane, book us now! https://brisbaneretainingwalls.net/">High-quality retaining walls in the Brisbane area
great post
great post.
good post.
great post.
very good post
That is really fascinating, You?re an excessively skilled blogger. I?ve joined your feed and look ahead to looking for more of your great posts
awesome material you fellas got these. I actually like the theme for the website along with how you organized a person who. It?s a marvelous job For certain i will come back and check out you out sometime
every post you publish is better than the last. I?m excited to see where you take this next
Ça marche pas o_O