IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Mise en page CSS Discussion :

coins arrondis CSS


Sujet :

CSS

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 13
    Par défaut coins arrondis CSS
    Bonjour à tous,

    Un petit problème qui devient gros vu le nombre d'heure que je passe à essayer de comprendre.

    J'utilise 4 images pour effectuer les arrondis d'un cadre qui lui même contient un contenu.

    Logiquement la div contenu devrait être tout en haut de la div cadre et tout en bas puisque puisque je lui donne une hauteur auto...

    mais cela ne fonctionne pas...

    Si quelqu'un a une solution...merci d'avance

    Un petit tour sur mon code

    HTML

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
     
    <div id="corps">
     
    	<div id="hautdroit"></div>
    	<div id="hautgauche"></div>
    	<div id="contenu">
    	    <p><strong>gdhdhdhgh</strong></p>
    	    <p><strong>dghgfhdgh</strong></p>
    	    <p><strong>dghdgndndn</strong></p>
    	    <p><strong>gnghhhghgh<br />
    	    ghghghghgh</strong></p>
    	</div>
                 <div id="basdroit"></div>
    	<div id="basgauche"></div>
    </div>
    CSS

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
     
     
    #corps
    {
    	width: 400px;
    	margin-top: 40px;
    	margin-right: 10px;
    	margin-left: 250px;
    	background-color: #FFFFFF;
    	font-family: Tahoma;
    	font-size: 12px;
    	height: auto;
    }
     
    #hautgauche, #hautdroit, #basgauche, #basdroit
    {
    height: 19px; width: 19px;
    background-repeat: no-repeat;
    font-size:1px;
    }
     
    #hautgauche 
    {
    	background-image: url(images1/hautgauchecorps.gif);
    }
     
     
    #hautdroit 
    {
    	float: right;
    	background-image: url(images1/hautdroitcorps.gif);
    }
     
     
    #basgauche 
    {
    background: url(images1/basgauchecorps.gif);
    }
     
     
    #basdroit 
    {
    float: right;
    background: url(images1/basdroitcorps.gif);
    }
     
     
    #contenu
    {
    	padding-right: 1em;
    	padding-left: 1em;
    	height: auto;
    	padding-bottom: 10px;
    	display: block;
    	border: 1px solid #0099FF;
    }

  2. #2
    Expert confirmé
    Avatar de 12monkeys
    Homme Profil pro
    Webmaster
    Inscrit en
    Novembre 2006
    Messages
    4 093
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Puy de Dôme (Auvergne)

    Informations professionnelles :
    Activité : Webmaster
    Secteur : Service public

    Informations forums :
    Inscription : Novembre 2006
    Messages : 4 093
    Par défaut
    Bonsoir

    J'ai pas bien compris ton problème, j'ai testé ton code et il fonctionne très bien chez moi, testé avec IE7 et Firefox 3

    Veux tu peut être que tes coins arrondis se retrouvent à l'intérieur du cadre bleu ? Pour l'instant ils se retrouvent à l'extérieur.

  3. #3
    Membre chevronné Avatar de GihefBey
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    366
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Avril 2006
    Messages : 366
    Par défaut
    Bonjour,

    Chez moi (Safari) le résultat est étrange. Les coins du haut semblent en dehors. Ceux du bas n'apparaissent pas.

    S'il ne s'agit que de créer des coins, pourquoi ne changerais-tu pas de méthode ?
    Place-les dans le #contenu (en relative) et positionne-les par absolute.

    -

  4. #4
    Membre averti
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 13
    Par défaut
    Pour expliquer mon pb je vous donne un lien qui résume ce que j'ai dit...

    http://www.d-lightproduction.com/home7.php

    Voila, le cadre Historique qui est fait de la même manière que le cadre Copyright en dessous ne s'interprête pas de la même manière, pourtant je les ai fait avec la même logique....Je souhaite que le cadre Historique ressemble au cadre Copyright, c-a-d que la div contenu soit collée à la div corps en haut et en bas. En mettant une bordure au contenu sur tous les cotés j'ai mon cadre qui se dessine en prenant en compte les coins.

    Si je mets le contenu en relatif et mes coins en absolute, j'ai un coin arrondi et en plus des coins carrés.

    Au fait, j'ai utilisé cette méthode :

    Faire un cadre arrondi en CSS et XHTML

    http://forum.pcastuces.com/coin_arro...s-f2s13482.htm

    Merci de votre aide...



    Voici le code complet de cette page.

    HTML

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
     
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Croix Blanche des Yvelines - Secouristes Fran&ccedil;ais</title>
     <link rel="stylesheet" media="screen" type="text/css" title="Mécanique" href="container7.css" />
     
    <script src="http://jqueryjs.googlecode.com/files/jquery-1.3.js" type="text/javascript"></script>
    <script src="js/jquery.easing.1.3.js" type="text/javascript"></script>
    <script src="animated-menu.js" type="text/javascript"></script>
     
     
     
     
     
    <script type="text/JavaScript">
    <!--
     
     
     
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    //-->
    </script>
    <style type="text/css">
    <!--
    .Style1 {
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 12px;
    }
    -->
    </style>
    </head>
     
    <body>
     
    <div id="en_tete">
     
    </div>
     
    <div id="container">
     
    	<div id="haut">
     
    	 	<div id="date"><?php
     
    $jour = date("d");
    $mois = date("m");
    $annee = date("Y");
     
     
    echo "Date : le $jour/$mois/$annee.";
    	?>
    	 	</div>
    		<img src="images1/KOKO.png" alt="Accueil" width="18" height="19" class="house" />
    		<img src="images1/lock_spinning.gif" alt="Extranet" width="25" height="25" class="cadena" />
     
    	</div>
     
    	<div id="recherche">
     
    	<form action="traitement.php" method="post" class="recherche">
       <p>
           <label><span class="Style1">Recherche</span></label>
           <span class="Style1"> :</span> 
           <input type="text" name="recherche" /> <INPUT type=submit value=Valider name=Submit>
       </p>
    </form>	
     
    	</div>
     
    	<div id="puce">
     
    	  			<div id="puce1"></div>
    	  			<div id="puce2"></div>
    				<div id="puce3"></div>
    				<div id="puce4"></div>
    				<div id="puce5"></div>
     
     	</div>
     
    	<div id="menu">
     
     
    			<ul>
    				<li class="menu1"><a href="#"><br/><br/>Formations</a></li>
    				<li class="menu2"><a href="#"><br/>Secours <br/>opérationnels</a></li>
    				<li class="menu3"><a href="#"><br/><br/>Téléchargements</a></li>
    				<li class="menu4"><a href="#"><br/><br/>Liens</a></li>
    				<li class="menu5"><a href="#"><br/><br/>Contacts</a></li>
    			</ul>
    	</div>
     
     
     
     
     	<div id="corps">
     
    		<div id="hautdroit"></div>
    		<div id="hautgauche"></div>
    	    <div id="contenu">HISTORIQUE
     
    	    </div>
    		<div id="basdroit"></div>
    		<div id="basgauche"></div>
    	</div>
     
    	<div id="footer">
    		<div id="hautfootdroit"></div>
    		<div id="hautfootgauche"></div>
    	    <div id="contenufoot">
    	  <br/>Copyright "Croix Blanche 78 , tous droits réservés	</div>
      </div>
    </div>
    </body>
    </html>
    CSS

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
     
    body
    {
       width: 760px;
       margin: auto; 
       margin-top: 20px; 
       background-image: url("images1/fond.png"); 
    }
     
    #en_tete
    {
    	width: 760px;
    	height: 143px;
    	background-image: url(images1/bandeau2.png);
    	background-repeat: no-repeat;
    	background-color: #FFFFFF;
    }
     
    #container
    {
    	background-color: #E6DFE6;
    	height: 675px;
    	width: 746px;
    	border: thin solid #0099FF;
    	padding-right: 5px;
    	padding-left: 5px;
    }
     
    #haut
    {
    	width: 745px;
    	background-color: #FFFFFF;
    	border-bottom-width: 1px;
    	border-bottom-style: solid;
    	border-bottom-color: #0099FF;
    	height: 55px;
    }
     
    #date
    {
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	padding: 3px;
    	text-align: left;
    }
     
    #menu
    {
    	float: left;
    	width: 110px;
    	left: 174px;
    	top: 167px;
    	margin-top: 45px;
    	padding-left: 10px;
    	font-family: Tahoma;
    	font-size: 12px;
    	height: auto;
    }
     
    #puce
    {
    	width: 20px;
    	height: 375px;
    	float: left;
    	margin-top: 45px;
    }
     
    #corps
    {
    	width: 400px;
    	margin-top: 40px;
    	margin-right: 10px;
    	margin-left: 250px;
    	background-color: #FFFFFF;
    	font-family: Tahoma;
    	font-size: 12px;
    	height: auto;
    }
     
    #hautgauche, #hautdroit, #basgauche, #basdroit
    {
    height: 19px; width: 19px;
    background-repeat: no-repeat;
    font-size:1px;
    }
     
    #hautgauche 
    {
    	background-image: url(images1/hautgauchecorps.gif);
    	left: 574px;
    	top: 356px;
    }
     
     
    #hautdroit 
    {
    	float: right;
    	background-image: url(images1/hautdroitcorps.gif);
    	left: 956px;
    }
     
     
    #basgauche 
    {
    background: url(images1/basgauchecorps.gif);
    }
     
     
    #basdroit 
    {
    float: right;
    background: url(images1/basdroitcorps.gif);
    }
     
     
    #contenu
    {
    	padding-right: 1em;
    	padding-left: 1em;
    	height: auto;
    	display: block;
    	border: 1px solid #0099FF;
    	padding-top: 0px;
    }
     
    ul{
    	margin:0;
    	padding:0;
    }
     
    li{
    	width:100px;
    	height:75px;
    	color:#191919;
    	text-align:left;
    	overflow:hidden;
    	padding-top: 0px;
    	margin-top: 0px;
    	margin-right: 0px;
    	margin-bottom: 0px;
    	margin-left: 0px;
    }
     
    p {
    	margin-top: 0px;
    }
     
     
    a{
    	color:#FFF;
    	text-decoration:none;
    }
     
    #puce1{
    	height: 75px;
    	width: 20px;
    	background-image: url(images1/puce.gif);
    	background-repeat: no-repeat;
    	background-position: center center;
    }
    #puce2{
    	height: 75px;
    	width: 20px;
    	background-image: url(images1/puce.gif);
    	background-repeat: no-repeat;
    	background-position: center center;
    }
    #puce3{
    	height: 75px;
    	width: 20px;
    	background-image: url(images1/puce.gif);
    	background-repeat: no-repeat;
    	background-position: center center;
    }
    #puce4{
    	height: 75px;
    	width: 20px;
    	background-image: url(images1/puce.gif);
    	background-repeat: no-repeat;
    	background-position: center center;
    }
    #puce5{
    	height: 75px;
    	width: 20px;
    	background-image: url(images1/puce.gif);
    	background-repeat: no-repeat;
    	background-position: center center;
    }
     
     
    .menu1{
    	margin: 0px;
    	clip: rect(0px,0px,0px,0px);
    	padding-top: 0px;
    	padding-right: 0px;
    	padding-bottom: 0px;
    	padding-left: 0px;
    	background-color: #393DBA;
    	background-image: url(images1/menu3.jpg);
    	background-repeat: no-repeat;
    	background-position: left top;
    	text-align: left;
    }
    .menu2{
    	background-color: #FFFFFF;
    	background-image: url(images1/menu3.jpg);
    	background-repeat: no-repeat;
    	background-position: left top;
    	text-align: left;
    	padding-top: 0px;
    }
    .menu3{
    	background-color: #FE0100;
    	background-image: url(images1/menu3.jpg);
    	background-repeat: no-repeat;
    	background-position: left top;
    	text-align: left;
    }
    .menu4{
    	background-color: #FD070E;
    	background-image: url(images1/menu3.jpg);
    	background-repeat: no-repeat;
    	background-position: left top;
    	text-align: left;
    }
    .menu5{
    	background-color: #FFFFFF;
    	background-image: url(images1/menu3.jpg);
    	background-repeat: no-repeat;
    	background-position: left top;
    	text-align: left;
    }
     
    .house
    {
    	margin-top: 9px;
    	margin-right: 0px;
    	margin-bottom: 3px;
    	margin-left: 50px;
    }
     
    .cadena
    {
    	margin-right: 0px;
    	margin-bottom: 0px;
    	margin-left: 15px;
    	margin-top: 9px;
    }
     
    #recherche
    {
    	width: 350px;
    	height: 30px;
    	left: 745px;
    	top: 255px;
    	text-align: center;
    	margin-left: 265px;
    	margin-top: 30px;
    }
     
    #footer 
    {
    	height: auto;
    	width: 400px;
    	text-align: center;
    	top: 776px;
    	left: 692px;
    	font-family: Tahoma;
    	font-size: 12px;
    	margin-left: 250px;
    	margin-top: 83px;
    	margin-bottom: 0px;
    }
     
    #hautfootgauche, #hautfootdroit
    {
    height: 19px; width: 19px;
    background-repeat: no-repeat;
    font-size:1px;
    }
     
    #hautfootgauche
    {
    	background: url(images1/hautgauchefoot.gif);
    	float: left;
    }
     
     
    #hautfootdroit 
    {
    	float: right;
    	background: url(images1/hautdroitfoot.gif);
    }
     
    #contenufoot
    {
    	padding-right: 1em;
    	padding-left: 1em;
    	height: auto;
    	padding-top: 0px;
    	padding-bottom: 10px;
    	left: 0px;
    	top: 0px;
    	display: block;
    	background-color: #FFFFFF;
    	border-right-width: 1px;
    	border-left-width: 1px;
    	border-right-style: solid;
    	border-left-style: solid;
    	border-right-color: #0099FF;
    	border-left-color: #0099FF;
    	border-top-width: 1px;
    	border-top-style: solid;
    	border-top-color: #0099FF;
    }

  5. #5
    Membre chevronné Avatar de GihefBey
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    366
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Avril 2006
    Messages : 366
    Par défaut
    Essaye
    Code CSS : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    #basgauche, #basdroit {
      margin-top: -19px;
      }
    #contenu {
    /*  padding-right: 1em;
      padding-left: 1em;
      height: auto;
      padding-bottom: 10px;
      display: block;*/
      border: 1px solid #09f;
    /*  border-right: 0;
      border-left: 0;*/
      }
    #contenu p {
      margin: 1em;
      }

    -

  6. #6
    Membre chevronné Avatar de desert
    Profil pro
    Inscrit en
    Mai 2007
    Messages
    414
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2007
    Messages : 414
    Par défaut
    Bonjour,
    Citation Envoyé par pulsefight
    Si je mets le contenu en relatif et mes coins en absolute, j'ai un coin arrondi et en plus des coins carrés.
    Il faut aussi indiquer leurs positions par rapport au div parent positionné en relatif sinon ils seront tous situés en haut à gauche par défaut, d'où le seul côté arrondi.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    #corps {
        position: relative;
    }
    #hautdroit, #hautgauche, #basdroit, #basgauche {
        position: absolute;
    }
    #hautdroit, #basdroit { 
        right: 0;  /* pour placer à droite */
    }
    #basdroit, #basgauche { 
        bottom: 0; /* pour placer en bas */
    }

Discussions similaires

  1. [Article] Créez des coins arrondis en CSS
    Par Bovino dans le forum Publications (X)HTML et CSS
    Réponses: 6
    Dernier message: 30/09/2010, 10h35
  2. [CSS 3] Coins arrondis CSS
    Par Ric21 dans le forum Mise en page CSS
    Réponses: 2
    Dernier message: 13/08/2010, 17h32
  3. [Article] Créer des coins arrondis à l'aide de Sprites CSS
    Par 12monkeys dans le forum Publications (X)HTML et CSS
    Réponses: 4
    Dernier message: 02/12/2009, 13h33
  4. [html - CSS] - Coins arrondis
    Par lhpp dans le forum Mise en page CSS
    Réponses: 13
    Dernier message: 04/10/2006, 16h04
  5. [CSS] Tableau aux coins arrondis (Sans images)
    Par FrankOVD dans le forum Mise en page CSS
    Réponses: 2
    Dernier message: 01/12/2005, 10h45

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo