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 :

Rollover avec superposition fond noir transparent et texte sur une image


Sujet :

CSS

  1. #1
    Membre régulier
    Profil pro
    Inscrit en
    Novembre 2006
    Messages
    378
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 378
    Points : 94
    Points
    94
    Par défaut Rollover avec superposition fond noir transparent et texte sur une image
    Bonsoir,

    Je cherche comment faire ou un tuto pour réaliser le cas suivant ou les termes que je dois chercher pour ce cas

    Je dispose d'une image qui est affichée
    Lorsque je passe la souris dessus, un fond noir transparent vient en superposition mais laisse transparaître un peu l'image
    Et sur le fond transparent je viens ajouter par dessus du texte

    Merci

  2. #2
    Expert confirmé
    Avatar de rodolphebrd
    Homme Profil pro
    Indépendant
    Inscrit en
    Novembre 2012
    Messages
    2 336
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Indépendant
    Secteur : Conseil

    Informations forums :
    Inscription : Novembre 2012
    Messages : 2 336
    Points : 5 443
    Points
    5 443
    Par défaut
    Bonjour,

    A partir de cette base vous pouvez travailler

    Code html : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    <div class="view">  
         <img src="image.gif" />  
         <div class="mask">  
         <h2>Title</h2>  
         <p>Your Text</p>  
             <a href="#" class="info">Read More</a>  
         </div>  
    </div>
    Styles de base:
    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
    .view {
       width: 300px;
       height: 200px;
       margin: 10px;
       float: left;
       border: 10px solid #fff;
       overflow: hidden;
       position: relative;
       text-align: center;
       box-shadow: 1px 1px 2px #e6e6e6;
       cursor: default;
       background: #fff url(../images/bgimg.jpg) no-repeat center center;
    }
    .view .mask,.view .content {
       width: 300px;
       height: 200px;
       position: absolute;
       overflow: hidden;
       top: 0;
       left: 0;
    }
    .view img {
       display: block;
       position: relative;
    }
    .view h2 {
       text-align: center;
       position: relative;
       padding: 10px;
       background: rgba(0, 0, 0, 0.8);
       margin: 20px 0 0 0;
    }
    .view p {
       position: relative;
       padding: 10px 20px 20px;
       text-align: center;
    }
    .view a.info {
       display: inline-block;
       text-decoration: none;
       padding: 7px 14px;
       background: #000;
       color: #fff;
       text-transform: uppercase;
       box-shadow: 0 0 1px #000;
    }
    .view a.info: hover {
       box-shadow: 0 0 5px #000;
    }
    effets:
    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
    .view img {
       -webkit-transition: all 0.2s ease-in;
       -moz-transition: all 0.2s ease-in;
       -o-transition: all 0.2s ease-in;
       -ms-transition: all 0.2s ease-in;
       transition: all 0.2s ease-in;
    }
    .view .mask {
       background-color: rgba(0,0,0,0.6);
       -ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)";
       filter: alpha(opacity=0);
       opacity: 0;
       -webkit-transform: translate(460px, -100px) rotate(180deg);
       -moz-transform: translate(460px, -100px) rotate(180deg);
       -o-transform: translate(460px, -100px) rotate(180deg);
       -ms-transform: translate(460px, -100px) rotate(180deg);
       transform: translate(460px, -100px) rotate(180deg);
       -webkit-transition: all 0.2s 0.4s ease-in-out;
       -moz-transition: all 0.2s 0.4s ease-in-out;
       -o-transition: all 0.2s 0.4s ease-in-out;
       -ms-transition: all 0.2s 0.4s ease-in-out;
       transition: all 0.2s 0.4s ease-in-out;
    }
    .view h2 {
       -webkit-transform: translateY(-100px);
       -moz-transform: translateY(-100px);
       -o-transform: translateY(-100px);
       -ms-transform: translateY(-100px);
       transform: translateY(-100px);
       -webkit-transition: all 0.2s ease-in-out;
       -moz-transition: all 0.2s ease-in-out;
       -o-transition: all 0.2s ease-in-out;
       -ms-transition: all 0.2s ease-in-out;
       transition: all 0.2s ease-in-out;
    }
    .view p {
       -webkit-transform: translateX(300px) rotate(90deg);
       -moz-transform: translateX(300px) rotate(90deg);
       -o-transform: translateX(300px) rotate(90deg);
       -ms-transform: translateX(300px) rotate(90deg);
       transform: translateX(300px) rotate(90deg);
       -webkit-transition: all 0.2s ease-in-out;
       -moz-transition: all 0.2s ease-in-out;
       -o-transition: all 0.2s ease-in-out;
       -ms-transition: all 0.2s ease-in-out;
       transition: all 0.2s ease-in-out;
    }
    .view a.info {
       -webkit-transform: translateY(-200px);
       -moz-transform: translateY(-200px);
       -o-transform: translateY(-200px);
       -ms-transform: translateY(-200px);
       transform: translateY(-200px);
       -webkit-transition: all 0.2s ease-in-out;
       -moz-transition: all 0.2s ease-in-out;
       -o-transition: all 0.2s ease-in-out;
       -ms-transition: all 0.2s ease-in-out;
       transition: all 0.2s ease-in-out;
    }
    .view:hover .mask {
       -ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)";
       filter: alpha(opacity=100);
       opacity: 1;
       -webkit-transition-delay: 0s;
       -moz-transition-delay: 0s;
       -o-transition-delay: 0s;
       -ms-transition-delay: 0s;
       transition-delay: 0s;
       -webkit-transform: translate(0px, 0px);
       -moz-transform: translate(0px, 0px);
       -o-transform: translate(0px, 0px);
       -ms-transform: translate(0px, 0px);
       transform: translate(0px, 0px);
    }
    .view:hover h2 {
       -webkit-transform: translateY(0px);
       -moz-transform: translateY(0px);
       -o-transform: translateY(0px);
       -ms-transform: translateY(0px);
       transform: translateY(0px);
       -webkit-transition-delay: 0.5s;
       -moz-transition-delay: 0.5s;
       -o-transition-delay: 0.5s;
       -ms-transition-delay: 0.5s;
       transition-delay: 0.5s;
    }
    .view:hover p {
       -webkit-transform: translateX(0px) rotate(0deg);
       -moz-transform: translateX(0px) rotate(0deg);
       -o-transform: translateX(0px) rotate(0deg);
       -ms-transform: translateX(0px) rotate(0deg);
       transform: translateX(0px) rotate(0deg);
       -webkit-transition-delay: 0.4s;
       -moz-transition-delay: 0.4s;
       -o-transition-delay: 0.4s;
       -ms-transition-delay: 0.4s;
       transition-delay: 0.4s;
    }
    .view:hover a.info {
       -webkit-transform: translateY(0px);
       -moz-transform: translateY(0px);
       -o-transform: translateY(0px);
       -ms-transform: translateY(0px);
       transform: translateY(0px);
       -webkit-transition-delay: 0.3s;
       -moz-transition-delay: 0.3s;
       -o-transition-delay: 0.3s;
       -ms-transition-delay: 0.3s;
       transition-delay: 0.3s;
    }
    http://codepen.io/anon/pen/GDlHk

  3. #3
    Membre régulier
    Profil pro
    Inscrit en
    Novembre 2006
    Messages
    378
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 378
    Points : 94
    Points
    94
    Par défaut
    Merci, c'est exactement cela
    Je vais analyser et adapter pour mon besoin

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

Discussions similaires

  1. [HTML] HTML: Superposer du texte sur une image
    Par claralavraie dans le forum Balisage (X)HTML et validation W3C
    Réponses: 7
    Dernier message: 09/02/2006, 13h44
  2. [HTML][DREAMWEAVER] Texte sur une image
    Par Nicos77 dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 12/10/2005, 09h43
  3. Centrer un texte sur une image créée dynamiquement
    Par rigolman dans le forum Langage
    Réponses: 7
    Dernier message: 11/10/2005, 17h22
  4. Positionnement de texte sur une image
    Par inddzen dans le forum Windows
    Réponses: 2
    Dernier message: 08/08/2005, 12h22
  5. [HTML]Peut-on écrire un texte sur une image ?
    Par flogreg dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 28/02/2005, 17h24

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