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 :

Centrer des éléments


Sujet :

Centrer un élément en CSS

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre à l'essai
    Homme Profil pro
    Technicien maintenance
    Inscrit en
    Novembre 2019
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Technicien maintenance
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Novembre 2019
    Messages : 5
    Par défaut Centrer des éléments
    Bonjour,
    Tout d'abord, merci pour ce tuto très complet, [Tutoriel] Création d'un site Portfolio avec BootStrap qui me permet de mieux comprendre le fonctionnement de HTML et CSS.
    J'en suis pour l'instant à la première partie du tuto, et il y a déjà 3 "problèmes" que je n'arrive pas à résoudre...
    En premier lieux, je me retrouve avec le titre (l'en-tête) qui n'est pas du tout centré.
    Ensuite, toujours en rapport avec l'en-tête, la barre de navigation n'est pas comme elle devrait l'être (complètement différente du rendu qui est montré).
    Et pour finir, je n'arrive pas non plus à centrer "A propos de moi" même en utilisant "text-align: center"

    Du coup, je voudrait bien savoir où se situent les causes de ces problèmes, car c'est assez perturbant...

    Je joint une capture d'écran, cela sera plus explicite.

    Par avance, merci

    Nom : Capture.PNG
Affichages : 167
Taille : 1,63 Mo

  2. #2
    Modérateur

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

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 227
    Par défaut
    Bonjour,
    en l'état il est difficile de t'aider efficacement, il faudrait que tu nous montres la structure HTML utilisée.

  3. #3
    Membre à l'essai
    Homme Profil pro
    Technicien maintenance
    Inscrit en
    Novembre 2019
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Technicien maintenance
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Novembre 2019
    Messages : 5
    Par défaut
    Bonjour,

    Déjà, merci pour la réponse.
    Voici le HTML et le CSS utilisés:
    Code html : 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
    <!doctype html>
    <html class="no-js" lang="fr">
     
    <head>
      <title>PortFolio</title>
      <meta charset="utf-8">
      <title></title>
      <meta name="description" content="">
      <meta name="viewport" content="width=device-width, initial-scale=1">
     
      <link rel="manifest" href="site.webmanifest">
      <link rel="apple-touch-icon" href="icon.png">
      <!-- Place favicon.ico in the root directory -->
      <!-- <meta name="theme-color" content="#fafafa"> -->
     
      <!-- BootStrap Core -->
      <link href="css/bootstrap.css" rel="stylesheet">
     
      <!-- Custom style -->
      <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet">
      <link rel="stylesheet" href="css/normalize.css">
      <link rel="stylesheet" href="css/main.css">
    </head>
     
    <body>
      <!--[if IE]>
        <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
      <![endif]-->
     
      <!-- Navbar -->
      <div class="navbar navbar-default navbar-fixed-top" role="navigation">
        <div class="container">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
              <span class="sr-only">Toggle Navigation</span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="index.html">Harry COVER - Freelance</a> 
          </div>
          <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav navbar-right">
              <li><a href="index.html">Home</a></li>
              <li><a href="html/blog.html">Blog</a></li>
              <li><a href="html/portfolio.html">Portfolio</a></li>
              <li><a href="html/a_propos.html">À Propos</a></li>
              <li><a href="html/contact.html">Contact</a></li>
            </ul>
          </div>
        </div>
      </div>
     
      <!-- Add your site or application content here -->
      <!-- Introduction -->
      <section id="home" name="home"></section>
      <div id="Introduction">
       <div class="container">
        <div class="row">
         <h1>Bienvenue sur mon portfolio !</h1>
         <br>
         <h3>Bonjour, mon nom est Harry COVER, bonne lecture à vous !</h3>
         <br>
         <br>
         <div class="col-lg-12">
         </div>
       </div>
     </div>
    </div>
    <script src="js/vendor/modernizr-3.7.1.min.js"></script>
    <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
    <script>window.jQuery || document.write('<script src="js/vendor/jquery-3.4.1.min.js"><\/script>')</script>
    <script src="js/plugins.js"></script>
    <script src="js/main.js"></script>
    <!-- About -->
    <section id="about" name="about"></section>
    <div id="f">
     <div class="container">
      <div class="row">
       <h3>A propos de moi</h3>
     
       <div class="col-lg-12">
        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
        <p>Je suis disponible pour du travail directement</p>
        <p><button type="button" class="btn btn-warning" href="#">J'ai une offre !</button></p>
      </div>
    </div>
    </div>
    </div>
    <br>
     
    <div>
     <div class="container">
      <div class="row centered">
       <div class="col-md-4">
        <i class="fa fa-heart"></i>
        <h4>Amoureux de la technologie</h4>
        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
        <p><br/><a href="#" class="btn btn-theme">En savoir plus</a></p>
      </div>
      <div class="col-md-4">
       <i class="fa fa-flask"></i>
       <h4>Chercher l'innovation</h4>
       <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
       <p><br/><a href="#" class="btn btn-theme">En savoir plus</a></p>
     </div>
     <div class="col-md-4">
       <i class="fa fa-trophy"></i>
       <h4>Réussir et partager</h4>
       <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
       <p><br/><a href="#" class="btn btn-theme">En savoir plus</a></p>
     </div>
    </div>
    </div>
    </div>
     
    <!-- Compétences -->
    <div id="Competences" class="text-center">
     <div class="container">
      <div class="section-title center">
       <h2>Un aperçu de mes compétences</h2>
       <div class="line">
        <hr>
      </div>
    </div>
    <div class="space"></div>
    <div class="row">
     <div class="col-md-3 col-sm-6 service">
      <i class="fa fa-desktop"></i>
      <h4>Web Design</h4>
      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
    </div>
    <div class="col-md-3 col-sm-6 service">
      <i class="fa fa-mobile"></i>
      <h4>Mobile First</h4>
      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
    </div>
    <div class="col-md-3 col-sm-6 service">
      <i class="fa fa-cloud"></i>
      <h4>Accessibilité</h4>
      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
    </div>
    <div class="col-md-3 col-sm-6 service">
      <i class="fa fa-code"></i>
      <h4>Coding fan</h4>
      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
    </div>
    </div>
    </div>
    </div>
     
    <!-- Footer -->
    <div class="footer text-center">
     <div class="container">
      <div class="row">
       <div class="col-lg-12">
        <h4 class="section-title center">Pied de page</h4>
        <div></div>
        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
      </div>
    </div>
    </div>
    </div>
     
    <!-- Google Analytics: change UA-XXXXX-Y to be your site's ID. -->
    <script>
      window.ga = function () { ga.q.push(arguments) }; ga.q = []; ga.l = +new Date;
      ga('create', 'UA-XXXXX-Y', 'auto'); ga('set','transport','beacon'); ga('send', 'pageview')
    </script>
    <script src="https://www.google-analytics.com/analytics.js" async></script>
     
    <!-- Script Javascript -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.3.min.js"><\/script>')</script>
    <script src="js/plugins.js"></script>
    <script src="js/main.js"></script>
    <script src="js/bootstrap.js"></script>
    </body>
     
    </html>

    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
    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
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    /*! HTML5 Boilerplate v7.2.0 | MIT License | https://html5boilerplate.com/ */
     
    /* main.css 2.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
    /*
     * What follows is the result of much research on cross-browser styling.
     * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
     * Kroc Camen, and the H5BP dev community and team.
     */
     
    /* ==========================================================================
       Base styles: opinionated defaults
       ========================================================================== */
     
    html {
      color: #222;
      font-size: 1em;
      line-height: 1.4;
    }
     
    /*
     * Remove text-shadow in selection highlight:
     * https://twitter.com/miketaylr/status/12228805301
     *
     * Vendor-prefixed and regular ::selection selectors cannot be combined:
     * https://stackoverflow.com/a/16982510/7133471
     *
     * Customize the background color to match your design.
     */
     
    ::-moz-selection {
      background: #b3d4fc;
      text-shadow: none;
    }
     
    ::selection {
      background: #b3d4fc;
      text-shadow: none;
    }
     
    /*
     * A better looking default horizontal rule
     */
     
    hr {
      display: block;
      height: 1px;
      border: 0;
      border-top: 1px solid #ccc;
      margin: 1em 0;
      padding: 0;
    }
     
    /*
     * Remove the gap between audio, canvas, iframes,
     * images, videos and the bottom of their containers:
     * https://github.com/h5bp/html5-boilerplate/issues/440
     */
     
    audio,
    canvas,
    iframe,
    img,
    svg,
    video {
      vertical-align: middle;
    }
     
    /*
     * Remove default fieldset styles.
     */
     
    fieldset {
      border: 0;
      margin: 0;
      padding: 0;
    }
     
    /*
     * Allow only vertical resizing of textareas.
     */
     
    textarea {
      resize: vertical;
    }
     
    /* ==========================================================================
       Browser Upgrade Prompt
       ========================================================================== */
     
    .browserupgrade {
      margin: 0.2em 0;
      background: #ccc;
      color: #000;
      padding: 0.2em 0;
    }
     
    /* ==========================================================================
       Author's custom styles
       ========================================================================== */
     
    /* Style Global */
     
    body {
     background: #ffffff;
     margin: 0;
     height: 100%;
     color: #384452;
     font-family: sans-serif;
     font-weight: 400;
    }
     
    h1, h2, h3, h4, H5, H6 {
     font-family: 'Raleway', sans-serif;
     font-weight: 700;
    }
     
    p {
     padding: 0;
     margin-bottom: 12px;
     font-family: 'Raleway', sans-serif;
     font-weight: 400;
     font-size: 14px;
     line-height: 24px;
     color: #384452;
     margin-top: 10px;
    }
     
    img {
     height: auto;
     max-width: 100%;
    }
     
    a {
     padding: 0;
     margin: 0;
     text-decoration: none;
     -webkit-transition: background-color .4s linear, color .4s linear;
     -moz-transition: background-color .4s linear, color .4s linear;
     -o-transition: background-color .4s linear, color .4s linear;
     -ms-transition: background-color .4s linear, color .4s linear;
     transition: background-color .4s linear, color .4s linear;
    }
    a:hover,
    a:focus {
     text-decoration: none;
     color: rgba(195, 197, 198, 0.87);
    }
     
    ::moz-selection {
     color: #fff;
     text-shadow: none;
     background: #2B2E31;
    }
     
    ::selection {
     color: #fff;
     text-shadow: none;
     background: #2B2E31;
    }
     
    .centered {
     text-align: center;
    }
     
    /* Style Navigation */
    .navbar {
     min-height: 70px;
     padding-top: 10px;
     margin-bottom: 0px;
    }
     
    .navbar-brand {
     font-family: 'Raleway', sans-serif;
     font-weight: 900;
    }
     
    .navbar-header .navbar-brand {
     color: red;
    }
     
    .navbar-default .navbar-nav > li > a {
     color: gold;
     font-weight: 700;
     font-size: 15px;
    }
     
    .navbar-default .navbar-nav > li > a:hover {
     color: rgba(172, 186, 191, 0.82);
    }
     
    .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus {
     color: rgba(172, 186, 191, 0.82);
     background: transparent;
    }
     
    .navbar-default {
     background-color: #384452;
     border-color: transparent;
    }
     
    /* Style Introduction */
    #Introduction {
     background: url(../img/background.jpg) no-repeat center top;
     margin-top: -10px;
     padding-top: 20px;
     text-align: center;
     background-attachment: relative;
     background-position: center center;
     min-height: 700px;
     width: 100%;
     
     -webkit-background-size: 100%;
        -moz-background-size: 100%;
        -o-background-size: 100%;
        background-size: 100%;
     
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
    }
     
    #Introduction h1 {
     margin-top: 150px;
     color: red;
     font-size: 50px;
     font-weight: 700;
    }
     
    #Introduction h3 {
     color: red;
     font-size: 30px;
     font-weight: 100;
     font-family: 'Raleway', sans-serif;
     font-style: oblique;
    }
     
    /* Style bouton */
    .btn-theme {
     color: #fff;
     background-color: #384452;
     border-color: #384452;
     margin: 4px;
    }
    .btn-theme:hover,
    .btn-theme:focus,
    .btn-theme:active,
    .btn-theme.active,
    .open .dropdown-toggle.btn-theme {
     color: #fff;
     background-color: #FCAC45;
     border-color: #ffffff;
    }
     
    /* Style About */
     
    #f {
     background: #384452;
     padding-top: 70px;
     padding-bottom: 70px;
     text-align: center;
    }
     
    #f h3 {
     color: white;
     font-size: 28px;
     font-weight: 700;
     letter-spacing: 1px;
     text-align: center;
    }
     
    #f icon {
     font-size: 8px;
     color: #fff;
     padding: 3px;
    }
     
    #f p {
     font-size: 20px;
     color: #f2f2f2;
    }
     
    #f img {
      text-align: center;
    }
     
    /* Compétences */
    #Competences {
     padding: 80px 0;
    }
     
    .espace {
     margin-top: 40px;
    }
     
    #Competences i.fa {
     font-size: 40px;
     border: solid #FCAC45 4px;
     width: 100px;
     height: 100px;
     padding: 27px 25px;
     margin-bottom: 10px;
     border-radius: 50%;
     transition: all 0.5s;
    }
     
    #Competences i.fa.fa mobile {
     font-size: 50px;
     padding: 20px 25px;
    }
     
    #Competences .Service:hover > i.fa {
     background: #FCAC45;
     color: #ffffff;
    }
     
    /* =========== Style a_propos.html ========== */
    #propos_hub {
      background: #FCAC45;
      margin-top: 60px;
      margin-bottom: 60px;
      padding-top: 25px;
      padding-bottom: 25px;
    }
     
    #propos_hub h3 {
      color:white;
      margin-left: 18px;
    }
     
    #propos {
      margin-top: 80px;
      margin-bottom: 80px;
    }
     
    #f_Propos {
      background: #384452;
      padding-top: 70px;
      padding-bottom: 70px;
      text-align: center;
    }
     
    #f_Propos h3 {
      color: white;
      font-size: 22px;
      font-weight: 450;
    }
     
     
    #f_Propos p {
      font-size: 20px;
      color: #f2f2f2; 
    }
     
    /* ========== Style portfolio.html =========== */
     
    /* Style Grille */
     
    .grille figure {
      margin: 0;
      position: relative;
    }
     
    .grille figure img {
      width: 100%;
      display: block;
      position: relative;
    }
     
    .grille figcaption {
      position: absolute;
      top: 0;
      left: 0;
      padding: 30px;
      color: #fff;
      background: #384452;
    }
     
    .grille figcaption h5 {
      margin: 0;
      padding-top: 0px;
      padding-left: 20px;
      padding-bottom: 5px;
      color: #fff;
      font-weight: 600;
      text-align: center;
      letter-spacing: 1px;
    }
     
    .grille figcaption a {
      text-align: left;
      padding: 5px 10px;
      margin-left: 20px;
      display: inline-block;
      background: #FCAC45;
      color: #fff;
      font-size: 15px;
    }
     
    /* Style Masque */
     
    .masque figure {
      overflow: hidden;
    }
     
    .masque figure img {
      -webkit-transition: -webkit-transform 0.4s;
      -moz-transition: -moz-transform 0.4s;
      transition: transform 0.4s;
    }
     
    .masque figcaption {
      height: 40px;
      width: 100%;
      top: auto;
      bottom: 0;
      opacity: 0;
      -webkit-transform: translateY(100%);
      -moz-transform: translateY(100%);
      -ms-transform: translateY(100%);
      transform: translateY(100%);
      -webkit-transition: -webkit-transform 0.4s, opacity 0.1s 0.3s;
      -moz-transition: -moz-transform 0.4s, opacity 0.1s 0.3s;
      transition: transform 0.4s, opacity 0.1s 0.3s;
    }
     
    .no-touch .masque figure:hover figcaption,
    .masque figure.cs-hover figcaption {
      opacity: 1;
      -webkit-transform: translateY(0px);
      -moz-transform: translateY(0px);
      -ms-transform: translateY(0px);
      transform: translateY(0px);
      -webkit-transition: -webkit-transform 0.4s, opacity 0.1s;
      -moz-transition: -moz-transform 0.4s, opacity 0.1s;
      transition: transform 0.4s, opacity 0.1s;
    }
     
    .masque figcaption a {
      position: absolute;
      top:10px;
      bottom: 10px;
      right: 30px;
    }
     
    /* ==========================================================================
       Helper classes
       ========================================================================== */
     
    /*
     * Hide visually and from screen readers
     */
     
    .hidden {
      display: none !important;
    }
     
    /*
    * Hide only visually, but have it available for screen readers:
    * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
    *
    * 1. For long content, line feeds are not interpreted as spaces and small width
    *    causes content to wrap 1 word per line:
    *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
    */
     
    .sr-only {
      border: 0;
      clip: rect(0, 0, 0, 0);
      height: 1px;
      margin: -1px;
      overflow: hidden;
      padding: 0;
      position: absolute;
      white-space: nowrap;
      width: 1px;
      /* 1 */
    }
     
    /*
    * Extends the .sr-only class to allow the element
    * to be focusable when navigated to via the keyboard:
    * https://www.drupal.org/node/897638
    */
     
    .sr-only.focusable:active,
    .sr-only.focusable:focus {
      clip: auto;
      height: auto;
      margin: 0;
      overflow: visible;
      position: static;
      white-space: inherit;
      width: auto;
    }
     
    /*
    * Hide visually and from screen readers, but maintain layout
    */
     
    .invisible {
      visibility: hidden;
    }
     
    /*
    * Clearfix: contain floats
    *
    * For modern browsers
    * 1. The space content is one way to avoid an Opera bug when the
    *    `contenteditable` attribute is included anywhere else in the document.
    *    Otherwise it causes space to appear at the top and bottom of elements
    *    that receive the `clearfix` class.
    * 2. The use of `table` rather than `block` is only necessary if using
    *    `:before` to contain the top-margins of child elements.
    */
     
    .clearfix:before,
    .clearfix:after {
      content: " ";
      /* 1 */
      display: table;
      /* 2 */
    }
     
    .clearfix:after {
      clear: both;
    }
     
    /* ==========================================================================
       EXAMPLE Media Queries for Responsive Design.
       These examples override the primary ('mobile first') styles.
       Modify as content requires.
       ========================================================================== */
     
    @media only screen and (min-width: 35em) {
      /* Style adjustments for viewports that meet the condition */
    }
     
    @media print,
      (-webkit-min-device-pixel-ratio: 1.25),
      (min-resolution: 1.25dppx),
      (min-resolution: 120dpi) {
      /* Style adjustments for high resolution devices */
    }
     
    /* ==========================================================================
       Print styles.
       Inlined to avoid the additional HTTP request:
       https://www.phpied.com/delay-loading-your-print-css/
       ========================================================================== */
     
    @media print {
      *,
      *:before,
      *:after {
        background: transparent !important;
        color: #000 !important;
        /* Black prints faster */
        -webkit-box-shadow: none !important;
        box-shadow: none !important;
        text-shadow: none !important;
      }
      a,
      a:visited {
        text-decoration: underline;
      }
      a[href]:after {
        content: " (" attr(href) ")";
      }
      abbr[title]:after {
        content: " (" attr(title) ")";
      }
      /*
         * Don't show links that are fragment identifiers,
         * or use the `javascript:` pseudo protocol
         */
      a[href^="#"]:after,
      a[href^="javascript:"]:after {
        content: "";
      }
      pre {
        white-space: pre-wrap !important;
      }
      pre,
      blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
      }
      /*
         * Printing Tables:
         * https://web.archive.org/web/20180815150934/http://css-discuss.incutio.com/wiki/Printing_Tables
         */
      thead {
        display: table-header-group;
      }
      tr,
      img {
        page-break-inside: avoid;
      }
      p,
      h2,
      h3 {
        orphans: 3;
        widows: 3;
      }
      h2,
      h3 {
        page-break-after: avoid;
      }
    }

    J'ai voulu suivre "à la lettre" le tuto, pour pouvoir comprendre au mieux les différentes "fonctionnalités" et non les personnaliser (ça, cela viendras quand j'aurais suffisamment travaillé dessus).

  4. #4
    Modérateur

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

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 227
    Par défaut
    En premier lieux, je me retrouve avec le titre (l'en-tête) qui n'est pas du tout centré.
    Cela semble normal, il y a un menu sur la droite.

    Ensuite, toujours en rapport avec l'en-tête, la barre de navigation n'est pas comme elle devrait l'être (complètement différente du rendu qui est montré).
    Effectivement il ne ressemble à rien sur ta capture, es tu sûr de la version de BootStrap ?

    Et pour finir, je n'arrive pas non plus à centrer "A propos de moi" même en utilisant "text-align: center"
    La construction m'a l'air correcte.

    Pourrais tu plutôt dans ce cas nous mettre une page en ligne pour que l'on voit vraiment les fichiers style utilisés et les styles appliqués à chacun de tes éléments.

    Tu peux le voir dans la console en faisant un click droitexaminer/inspecter l'élément.

  5. #5
    Membre à l'essai
    Homme Profil pro
    Technicien maintenance
    Inscrit en
    Novembre 2019
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Technicien maintenance
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Novembre 2019
    Messages : 5
    Par défaut
    Citation Envoyé par NoSmoking Voir le message
    Cela semble normal, il y a un menu sur la droite.
    Oui, mais justement, ce problème est (selon moi) lié au second problème (le fait que le menu soit placé sous l'espèce de barre). C'est pas ça ?

    Effectivement il ne ressemble à rien sur ta capture, es tu sûr de la version de BootStrap ?
    J'ai utilisé Bootstrap v4.3.1 Compiled CSS and JS (c'est ce qui est demandé, il me semble).

    La construction m'a l'air correcte.
    Ok, donc au moins un point positif...

    Pourrais tu plutôt dans ce cas nous mettre une page en ligne pour que l'on voit vraiment les fichiers style utilisés et les styles appliqués à chacun de tes éléments.
    Tu peux le voir dans la console en faisant un click droitexaminer/inspecter l'élément.
    Comment je suis censé faire ?

  6. #6
    Expert confirmé
    Avatar de ProgElecT
    Homme Profil pro
    Retraité
    Inscrit en
    Décembre 2004
    Messages
    6 132
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 69
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Retraité
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Décembre 2004
    Messages : 6 132
    Par défaut
    Salut

    Pourrais tu plutôt dans ce cas nous mettre une page en ligne pour que l'on voit vraiment les fichiers style utilisés et les styles appliqués à chacun de tes éléments.
    Tu peux le voir dans la console en faisant un click droitexaminer/inspecter l'élément.
    Comment je suis censé faire ?
    Par exemple avec Firefox, la touche F12 ou Ctrl+MAJ+I t'ouvre l'outil du développement web.
    :whistle:pourquoi pas, pour remercier, un :plusser: pour celui/ceux qui vous ont dépannés.
    saut de ligne
    OOOOOOOOO👉 → → Ma page perso sur DVP ← ← 👈

  7. #7
    Membre à l'essai
    Homme Profil pro
    Technicien maintenance
    Inscrit en
    Novembre 2019
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Technicien maintenance
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Novembre 2019
    Messages : 5
    Par défaut
    Re-bonjour,

    Bon, je me suis penché sur les différents problèmes, et maintenant cela fonctionne (en résumé, il fallait prendre une très ancienne version de BS (3.4.1) car avec les plus récentes, ce n'était pas compatible).

    Du coup, maintenant, j'ai un autre problème (au niveau du chapitre 3 du tuto), concernant la page "PortFolio.html", sujet d'une autre discussion.

    Merci aux intervenants

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

Discussions similaires

  1. centrer des éléments dans une grid
    Par antho_gpz dans le forum GUI
    Réponses: 2
    Dernier message: 23/05/2016, 16h43
  2. Centrer verticalement des éléments
    Par rolandl dans le forum Mise en page CSS
    Réponses: 1
    Dernier message: 03/09/2015, 12h28
  3. Centrer des éléments superposés
    Par krunch dans le forum Mise en page CSS
    Réponses: 7
    Dernier message: 10/04/2014, 19h10
  4. Centrer des éléments
    Par nixonne dans le forum Mise en page CSS
    Réponses: 7
    Dernier message: 12/02/2009, 17h06
  5. Réponses: 4
    Dernier message: 26/07/2007, 14h41

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