28220 sujets

CSS et mise en forme, CSS3

bonjour je me suis mis au CSS il y a seulement quelques jours. j'ai un probleme sur un layout que je viens de faire.
La partie centrale est un tableau à 3 cellules. ce tableau est contenu dans un div de class "navboxauto_innermain". le problème, c'est que le tableau ne veut pas s'aligner au top du div (pb sous IE seulement). L'alignement horizontal n'est pas le même non plus. en gros c'est deformé. etant donné que c'est assez compliqué pour moi d'expliquer ca clairement, je préfère vous faire voir le site Smiley biggrin

http://notoon.free.fr/notoondesign/modele.htm

et voici mon css :


body {
	background-image: url(../layout/bg.gif);
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	font-family: Verdana;
	font-size: 8pt;
	color: #000000;
}

a:link { font-family: Verdana; font-size: 8pt; color: Blue; text-decoration: none; }
a:visited { font-family: Verdana; font-size: 8pt; color: #000000; text-decoration: none; }
a:active { font-family: Verdana; font-size: 8pt; color: #000000; text-decoration: none; }
a:hover { font-family: Verdana; font-size: 8pt; color: Green; text-decoration: underline;}

/* TABLEAU CONTENANT LE FOND DEGRADE */
TABLE.container {
	background-image: url(../layout/bg_fix.gif);
	background-repeat: repeat-x;
	width: 100%;
	border: 0px;
	padding: 10px;
}

/* TABLEAU DU CONTENU */
TABLE.inner {
	width: 770px;
	border: 0px;
	padding: 0px;
	background: url(../layout/bottom.gif);
	background-position: bottom;
	background-repeat: no-repeat;
}

/* LAYOUT */
.navrboxcont_innertop { background-image: url(../layout/top.gif); width: 770px; height:80px; }
.navrboxright_innertop { width:468px; float:right; height:60px ; padding: 10px; }
.navrboxauto_innertop { text-align: left; margin-right:488px; width:auto; height:60px ; padding: 10px; }
.padbcont_innerlogo { background-image: url(../layout/logo.jpg); width:770px; height:136px }
.navboxcont_innermain { background-color: #FFFFFF; width: 770px; margin-bottom: 10px; }
.navboxleft_innermain { width:210px; height: inherit; float:left; padding-top: 20px; }
.navboxauto_innermain { margin-left: 210px; width: 560px; height: inherit; vertical-align: top; padding: 0px; }
.navcont_menu { width: 210px }
.navbox_menu { width: 210px; height:inherit }

/* CONTENT */
.navcont_favourites { background-color: #e9ebf0; width: 100%; height: 250px; border: dashed 1px #aeb5c8; }
.navtitle_favourites { background-image: url(../layout/content_random_favourite.gif); background-repeat: no-repeat; width:100%; height:10px ; padding: 0; }
.navbox_favourites { width:100%; height:inherit ; padding: 5px; }
.navcont_posts { background-color: #e9ebf0; width: 100%; height: 250px; border: dashed 1px #aeb5c8; }
.navtitle_posts { background-image: url(../layout/content_latest_forum.gif); background-repeat: no-repeat; width:100%; height:10px ; padding: 0; }
.navbox_posts { width:100%; height:inherit ; padding: 5px; }
.navcont_news { background-color: #e9ebf0; width: 100%; height: inherit; border: dashed 1px #aeb5c8; }
.navtitle_news { background-image: url(../layout/content_news.gif); background-repeat: no-repeat; width:100%; height:10px ; padding: 0; }
.navbox_news { width:100%; height:inherit ; padding: 5px; }
TD.halfcontent {
	vertical-align: top;
	width: 50%;
}
TD.fullcontent {
	vertical-align: top;
	width: 100%;
}

/*COPYRIGHT*/
.copyright {
	font-family: Verdana;
	font-size: 8pt;
	color: #FFFFFF;
	text-align: center;
}


merci pour votre aide !!
Modifié par notoon (19 Jul 2005 - 16:15)
Salut,
je viens de passer une petite heure sur ton code : quelle pagaille. Mélange de tableaux html et de div en pagaille complètement inutiles. Comme en plus tu as fixé les dimensions en pixels, il est probable que le problème sous IE vienne de son interprétation des bordures qui sont ajoutées aux dimensions au lieu d'en faire partie, ce qui fait que la largeur totale excède la largeur du contenant global, il n'y a donc plus la place à droite du menu de navigation pour rentrer le contenu principal.

Si tu veux un conseil pratique: revois ta copie. Vire les tableaux HTML et utilise les positionnements CSS. En parcourant les tutos sur le site, tu vas te rendre compte à l'usage que tu peux couper ton code en deux pour exactement le même résultat. Ça aura plusieurs avantages: chargement plus rapide de la page et surtout lecture plus facile en débuggage.

Petit exemple de simplification: le code de ton menu actuel :
<div class="navboxleft_innermain">
  <div class="navcont_menu">
    <!--agl:cssobject id="menu" type="Navi Rows"-->
    <div class="navbox_menu"><img src="layout/menu_home.gif" alt="Accueil" width="210" height="20" border="0"></div>
    <div class="navbox_menu"><img src="layout/menu_inter.gif" alt="" width="3" height="10" border="0"></div>
    <div class="navbox_menu"><img src="layout/menu_portfolio.gif" alt="Toutes mes créations" width="210" height="20" border="0"></div>
    <div class="navbox_menu"><img src="layout/menu_inter.gif" alt="" width="3" height="10" border="0"></div>
    <div class="navbox_menu"><img src="layout/menu_curriculum.gif" alt="Curriculum Vitae" width="210" height="20" border="0"></div>
    <div class="navbox_menu"><img src="layout/menu_inter.gif" alt="" width="3" height="10" border="0"></div>
    <div class="navbox_menu"><img src="layout/menu_tutorials.gif" alt="Cours et Tutoriaux" width="210" height="20" border="0"></div>
    <div class="navbox_menu"><img src="layout/menu_inter.gif" alt="" width="3" height="10" border="0"></div>
    <div class="navbox_menu"><img src="layout/menu_forum.gif" alt="La Communauté" width="210" height="20" border="0"></div>
    <div class="navbox_menu"><img src="layout/menu_inter.gif" alt="" width="3" height="10" border="0"></div>
    <div class="navbox_menu"><img src="layout/menu_guestbook.gif" alt="Livre d'or" width="210" height="20" border="0"></div>
    <div class="navbox_menu"><img src="layout/menu_inter.gif" alt="" width="3" height="10" border="0"></div>
    <div class="navbox_menu"><img src="layout/menu_misc_artworks.gif" alt="Créations d'autres artistes" width="210" height="20" border="0"></div>
    <div class="navbox_menu"><img src="layout/menu_inter.gif" alt="" width="3" height="10" border="0"></div>
    <div class="navbox_menu"><img src="layout/menu_funstuff.gif" alt="Amusez-vous !" width="210" height="20" border="0"></div>
  </div>
</div>

Pourrait avantageusement être réduit à ceci:
  <div class="navcont_menu">
    <!--agl:cssobject id="menu" type="Navi Rows"-->
    <img src="layout/menu_home.gif" alt="Accueil" width="210" height="20" border="0">
    <img src="layout/menu_portfolio.gif" alt="Toutes mes créations" width="210" height="20" border="0">
    <img src="layout/menu_curriculum.gif" alt="Curriculum Vitae" width="210" height="20" border="0">
    <img src="layout/menu_tutorials.gif" alt="Cours et Tutoriaux" width="210" height="20" border="0">
    <img src="layout/menu_forum.gif" alt="La Communauté" width="210" height="20" border="0">
    <img src="layout/menu_guestbook.gif" alt="Livre d'or" width="210" height="20" border="0">
    <img src="layout/menu_misc_artworks.gif" alt="Créations d'autres artistes" width="210" height="20" border="0">
    <img src="layout/menu_funstuff.gif" alt="Amusez-vous !" width="210" height="20" border="0">
  </div>

En supprimant les div encadrant chaque image et en virant les espaceurs, tu remplaces par un style plus simple:
.navcont_menu img {margin-bottom: 3px}
D'accord je vais essayer ce que tu me dis de faire. j'ai encore du mal avec les css, c'est pour ca que j'ai mis un tableau avec un colspan pour essayer d'aligner directement Smiley smile
merci pour ton aide et ta patience Smiley biggrin