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 :

Media quieries décalage du body


Sujet :

CSS

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti Avatar de pilan
    Femme Profil pro
    Etudiant
    Inscrit en
    Décembre 2020
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 31
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Etudiant

    Informations forums :
    Inscription : Décembre 2020
    Messages : 42
    Par défaut Media quieries décalage du body
    Bonjour à tous,

    Je rencontre un problème lorsque j'applique mes médias, j'ai un décalage à droite du body présent sur plusieurs tailles d'écran.
    Comment rendre automatiquement la largeur du corps égale à la largeur de l'appareil dans la requête multimédia CSS3?

    J'ai essayé d'introduire un width à 100% mais je crois que cela ne change pas grand chose.
    Un écran normalement ne devrait pas bouger ni de droite ni de gauche mais seul le haut et bas pour la navigation , nous sommes bien d'accord ?
    Je voudrai rajouter à chaque media la propriété body avec sa valeur.
    Merci de votre aide

    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
    @media screen and (max-width: 999px) {
      .logo {
        padding: 0%;
        margin: 2rem 17rem 0 2rem;
      }
     
    }
     
    @media screen and (max-width: 600px) {
     
      .logo {
        margin-bottom: 20px;
      }
     
    }
    @media screen and (max-width: 320px) {
      .logo {
        height: 2em;
        width: 4em;
      }
    }

  2. #2
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    17 228
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 228
    Par défaut
    Bonjour,
    sans un minimum de code HTML, nécessaire à la reproduction du dysfonctionnement et voir le rendu, difficile de t'aider !

  3. #3
    Membre averti Avatar de pilan
    Femme Profil pro
    Etudiant
    Inscrit en
    Décembre 2020
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 31
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Etudiant

    Informations forums :
    Inscription : Décembre 2020
    Messages : 42
    Par défaut
    Oui, je vais partager mon code html.

  4. #4
    Membre averti Avatar de pilan
    Femme Profil pro
    Etudiant
    Inscrit en
    Décembre 2020
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 31
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Etudiant

    Informations forums :
    Inscription : Décembre 2020
    Messages : 42
    Par défaut code 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
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    * {
      font-family: "Raleway";
      margin: 0;
      padding: 0;
    }
    body {
      max-width: 1168px;
      box-shadow: 0 0 10px #f2f2f2;
      -moz-box-shadow: 0 0 10px #f2f2f2;
    }
    .logo {
      height: 3em;
      width: 5em;
      padding: 45px 0px 0px 20px;
      margin-right: 43rem;
    }
     
    nav {
      display: -moz-box;
      display: flex; /* Les éléments s'alignent sur l'axe*/
    }
    nav ul {
      display: -moz-inline-box;
      display: inline-flex; /* Les éléments s'alignent sur l'axe*/
      -moz-box-align: center;
      align-items: center; /* gestion de l'alignement vertical au centre */
    }
    nav ul li {
      list-style-type: none;
      padding-right: 3rem;
    }
    .link-register-nav a {
      color: #0065fc;
      line-height: 5.2;
      font-weight: bold;
      display: contents;
    }
    .Accommodation {
      color: #0065fc;
      border-top: 2px solid #0065fc;
      padding-top: 2rem;
    }
     
    .Tittle-header {
      padding: 6px 0 0 0;
      padding-left: 20px;
    }
     
    .p1 {
      padding-left: 5px;
      margin-bottom: 10px;
    }
     
    input {
      padding: 13px 16px;
      border: 2px solid #f2f2f2;
      font-weight: bold;
    }
    .input-search {
      padding: 0.5rem;
      display: -moz-box;
      display: flex;
    }
     
    button {
      padding: 15px 18px;
      color: white;
      border: 0.5px solid #f2f2f2;
      border-top-right-radius: 15px;
      border-bottom-right-radius: 15px;
      -moz-border-radius-topright: 15px;
      border-top-right-radius: 15px;
      -moz-border-radius-bottomright: 15px;
      border-bottom-right-radius: 15px;
      background-color: #0065fc;
    }
     
    .fa-map-marker-alt {
      border: 2px solid #f2f2f2;
      border-top-left-radius: 2rem;
      border-bottom-left-radius: 2rem;
      -moz-border-radius-topleft: 2rem;
      border-top-left-radius: 2rem;
      -moz-border-radius-bottomleft: 2rem;
      border-bottom-left-radius: 2rem;
      padding: 0.9rem 0.9rem;
      background-color: #f2f2f2;
    }
    .fa-search {
      display: none;
    }
     
    #filter ul {
      display: -moz-box;
      display: flex;
      -moz-box-align: center;
      align-items: center;
    }
     
    #filter ul li {
      list-style: none;
      display: -moz-inline-box;
      display: inline-flex;
      -moz-box-align: center;
      align-items: center;
      -moz-box-pack: start;
      justify-content: flex-start;
      font-weight: bold;
      border: 3px solid #f2f2f2;
      -moz-border-radius: 3rem;
      border-radius: 3rem;
      margin: 1rem;
    }
     
    #filter ul li:hover {
      background-color: #0065fc;
      cursor: pointer; /* souris lors de la selection */
      -moz-transition: transform 0.5s, -moz-transform 0.5s;
      transition: transform 0.5s;
      transition: transform 0.5s, -moz-transform 0.5s;
      -moz-transform: scale(1.1);
      transform: scale(1.1);
    }
    #filter li {
      text-align: center;
      padding-right: 0.9em;
    }
    h1 {
      margin-bottom: 6px;
      font-size: 1.5rem;
      margin-right: 2rem;
    }
     
    .fa-money-bill-wave,
    .fa-child,
    .fa-heart,
    .fa-dog {
      color: #0065fc;
      width: 1rem; /* pour un rendu carré */
      height: 1rem; /* pour un rendu carré */
      -moz-border-radius: 50%;
      border-radius: 50%; /* rendu ideal pour un cercle*/
      background-color: #deebff; /* couleur de fond */
      padding: 1.1rem;
      margin-right: 1.1rem;
      margin-left: -0.5rem;
    }
     
    .result {
      padding: 2px 0 0 10px;
      margin-bottom: 45px;
    }
    .p2 {
      margin-bottom: 1rem;
    }
     
    .fa-info {
      margin: 0rem 0.3rem; /* espace droit entre le logo et p */
      border: 2.5px solid #f2f2f2;
      width: 1em; /* pour un rendu carré */
      height: 1em; /* pour un rendu carré */
      -moz-border-radius: 50%;
      border-radius: 50%; /* rendu ideal pour un cercle*/
      color: #0065fc; /*couleur du logo*/
      padding: 6px; /*marge intérieur*/
      font-size: 0.4em; /*taille du logo*/
      display: inline;
    }
     
    h2 {
      font-size: 1.2em;
      padding: 1rem;
      line-height: 4rem;
    }
    .display-filter {
      display: -moz-inline-box;
      display: inline-flex;
    }
    .image {
      width: 190px;
      height: 100px;
      object-fit: cover;
      -moz-border-radius: 1rem 1rem 0 0;
      border-radius: 1rem 1rem 0 0;
    }
     
    h3 {
      font-size: 1.2rem;
      margin-left: 0.8rem;
      padding-top: 1rem;
    }
     
    h4 {
      padding-bottom: 0.3em;
    }
     
    .fa-star {
      color: #0065fc;
      font-size: 0.6em;
    }
     
    .price {
      font-size: 0.8rem;
    }
    .parent {
      display: -moz-box;
      display: flex;
      justify-content: space-around;
    }
    .First-section {
      background-color: #f2f2f2;
      padding: 0px 11px 0px 11px;
      -moz-border-radius: 10px 10px 10px 10px;
      border-radius: 10px 10px 10px 10px;
    }
     
    article {
      border-radius: 10px;
      -moz-border-radius: 10px;
      -moz-box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
      box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
      padding: 6px 6px 6px 6px;
      margin: 10px 10px;
      background-color: white;
      -moz-transition-duration: 0.1s;
      transition-duration: 0.1s;
      cursor: pointer;
    }
     
    a {
      color: inherit; /* Aucune couleur de fond pour les liens articles et listes*/
      text-decoration: none;
    }
    .Lodging-article {
      display: -moz-box;
      display: flex; /* Les éléments se mettent les uns à côté des autres */
      margin-top: 10px;
    }
    .icon-star-4 .fas.fa-star:nth-child(4) {
      color: #f2f2f2;
    }
    .icon-star-4 .fas.fa-star:nth-child(5) {
      color: #f2f2f2;
    }
    .icon-star-5 .fas.fa-star:nth-child(5) {
      color: #f2f2f2;
    }
    .icon-star-1 .fas.fa-star:nth-child(5) {
      color: #f2f2f2;
    }
    .icon-star-3 .fas.fa-star:nth-child(5) {
      color: #f2f2f2;
    }
    .icon-star-popular2 .fas.fa-star:nth-child(5) {
      color: #f2f2f2;
    }
    .icon-star-popular3 .fas.fa-star:nth-child(5) {
      color: #f2f2f2;
    }
    .More-element {
      /* Texte de fin de First-section*/
      font-weight: bold;
      padding: 2rem 1rem;
    }
    article:hover {
      /* Effet au survol*/
      cursor: pointer;
      transition: transform 0.5s, -moz-transform 0.5s;
      -moz-transform: scale(1.1);
      transform: scale(1.1);
    }
     
    .location-popular {
      /* Deuxiéme section*/
      width: 115px;
      height: 105px;
      object-fit: cover;
      -moz-border-radius: 1rem 0rem 0 1rem; /* Compatibilité avec Firefox*/
      border-radius: 1rem 0rem 0 1rem; /*Bordure arrondie angles gauche */
    }
     
    .Second-section article {
      /* Selection des articles de la deuxiéme section*/
      -moz-border-radius: 10px;
      border-radius: 10px;
      width: 295px;
      -moz-box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
      box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
      padding: 6px 6px 2px 6px;
      margin: 28px 15px;
      background-color: white;
    }
     
    .text-img {
      /* description apporté a chaque article de la section*/
      float: right;
      padding: 0.5rem 0.5rem 0 0;
      margin-right: 2rem;
    }
    .price-activity {
      font-size: 0.8rem;
      padding-bottom: 20px;
    }
    h5 {
      padding-bottom: 9px;
      font-size: 0.9rem;
    }
     
    aside:hover {
      cursor: pointer; /*curosr s'affiche lors du passage de la souris*/
      -moz-transition: transform 0.5s, -moz-transform 0.5s;
      transition: transform 0.5s;
      transition: transform 0.5s, -moz-transform 0.5s;
      -moz-transform: scale(1.1);
      transform: scale(1.1);
    }
     
    .fa-chart-line {
      padding-left: 4.9rem;
    }
     
    .Second-section {
      background-color: #f2f2f2;
      padding: 0px 10px 0px 10px;
      -moz-border-radius: 10px 10px 10px 10px;
      border-radius: 10px 10px 10px 10px;
    }
     
    .Last-section .article-section-activity {
      -moz-border-radius: 15px;
      border-radius: 15px;
      -moz-box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
      box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
      background-color: white;
      padding: 0;
      margin: 2.4rem 1.1rem 1.1rem 0.8rem;
    }
     
    .Last-section {
      margin: 2rem 2rem;
    }
    .place-1-activity {
      height: 310px;
      width: 240px;
      object-fit: cover;
      -moz-border-radius: 1rem 1rem 0 0;
      border-radius: 1rem 1rem 0 0;
    }
     
    .tittle-of-place {
      padding: 0.5rem 0 0.5rem 1rem;
    }
    .place-2-activity {
      height: 132px;
      width: 260px;
      -moz-border-radius: 1rem 1rem 0 0;
      border-radius: 1rem 1rem 0 0;
      object-fit: cover;
    }
     
    .place-3-activity {
      width: 260px;
      height: 100px;
      object-fit: cover;
      -moz-border-radius: 1rem 1rem 0 0;
      border-radius: 1rem 1rem 0 0;
    }
    .place-4-activity {
      height: 310px;
      width: 240px;
      -moz-border-radius: 1rem 1rem 0 0;
      border-radius: 1rem 1rem 0 0;
      object-fit: cover;
    }
    .tittle-of-place-4 {
      padding: 0.5rem 0.5rem 0.5rem 1rem;
    }
    .place-5-activity {
      height: 100px;
      width: 260px;
      object-fit: cover;
      -moz-border-radius: 1rem 1rem 0 0;
      border-radius: 1rem 1rem 0 0;
    }
    h4 {
      font-size: small;
    }
    .place-6-activity {
      height: 130px;
      width: 260px;
      object-fit: cover;
      -moz-border-radius: 1rem 1rem 0 0;
      border-radius: 1rem 1rem 0 0;
    }
     
    .Article-activity-flex {
      display: -moz-inline-box;
      display: inline-flex;
    }
     
    .item-2-3-flex {
      margin-bottom: 1rem; /*marge extérieur des blocs*/
    }
     
    .Footer {
      display: -moz-inline-box;
      margin-right: 20rem;
      display: flex;
      justify-content: space-around;
    }
     
    .mainfooter {
      font-size: 0.8rem;
      background-color: #f2f2f2;
      padding: 1rem 1rem;
    }
     
    .mainfooter li {
      margin-bottom: 0.8rem;
      list-style-type: none;
    }
    .About-logding {
      margin: 0 12rem; /* 12 marges extérieurs left and right*/
    }

  5. #5
    Membre averti Avatar de pilan
    Femme Profil pro
    Etudiant
    Inscrit en
    Décembre 2020
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 31
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Etudiant

    Informations forums :
    Inscription : Décembre 2020
    Messages : 42
    Par défaut code html
    Code html : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    <!DOCTYPE html>
    <html lang="fr">
      <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <link
          rel="stylesheet"
          href="Public/Fontawesome/fontawesome-free-5.15.1-web/css/all.min.css"
        />
     
        <link rel="stylesheet" href="Public/css/style.css" />
        <title>Reservia</title>
      </head>

  6. #6
    Membre chevronné
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Juillet 2013
    Messages
    269
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2013
    Messages : 269
    Par défaut
    Bonjour,

    il semble manquer le <body> dans ton exemple.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Décalage du body lors d'un clic sur une image (Fancybox)
    Par dhillig dans le forum Mise en page CSS
    Réponses: 9
    Dernier message: 10/02/2015, 08h22
  2. Pb de décalage avec Windows Media 11 et 12
    Par seb1971 dans le forum Vidéo
    Réponses: 0
    Dernier message: 05/11/2010, 12h16
  3. Décalage complet du site par raport au body sous ie
    Par nO_life dans le forum Mise en page CSS
    Réponses: 4
    Dernier message: 02/12/2008, 21h11
  4. [HTML] Problème de Décalage body avec ancre html.
    Par bobomasterflash dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 13/12/2007, 09h50
  5. [CSS]media print et décalage à gauche du texte
    Par maxo dans le forum Mise en page CSS
    Réponses: 4
    Dernier message: 02/06/2006, 17h21

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