Rendre un background cliquable...
Résolu
zippeur
Messages postés
197
Date d'inscription
Statut
Membre
Dernière intervention
-
Mihawk Messages postés 4315 Date d'inscription Statut Contributeur Dernière intervention -
Mihawk Messages postés 4315 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour,
je ne trouve pas l'astuce pour rendre un background cliquable...
Pour exemple, je souhaiterais arriver à ça image des produits top a c h a c'est des images en background mais cliquable
PLSS HELP
Merci pour votre attention
__________________________________
<div 'style='text-align: left; height: 215px; background: url(images/imagespro/$image)
no-repeat scroll center top transparent; padding: 0px;'>
je ne trouve pas l'astuce pour rendre un background cliquable...
Pour exemple, je souhaiterais arriver à ça image des produits top a c h a c'est des images en background mais cliquable
PLSS HELP
Merci pour votre attention
__________________________________
<div 'style='text-align: left; height: 215px; background: url(images/imagespro/$image)
no-repeat scroll center top transparent; padding: 0px;'>
A voir également:
- Rendre un background cliquable...
- Comment rendre un fichier moins lourd - Guide
- Windows 7 logon background changer - Télécharger - Thèmes & Fonds d'écran
- Sommaire cliquable word - Guide
- Comment nettoyer son mac pour le rendre plus rapide - Guide
- Image cliquable html - Forum HTML
4 réponses
Bonjour, tu peux mettre une img dans un lien:
<a href="monlien"><img src="img1.jpg" width="500px" height="500px" /></a>
ou sinon mettre un lien en display: block; et y mettre une image de fond je pense.
#monlien {
display: block;
width: 500px;
height: 500px;
background: url('img1.jpg') no-repeat center ;
}
A confirmer
+++ Spangenhelm +++
<a href="monlien"><img src="img1.jpg" width="500px" height="500px" /></a>
ou sinon mettre un lien en display: block; et y mettre une image de fond je pense.
#monlien {
display: block;
width: 500px;
height: 500px;
background: url('img1.jpg') no-repeat center ;
}
A confirmer
+++ Spangenhelm +++
Hello,
Tu peux aussi appliquer à la div concerné un background ET un évènement onclick :
Tant qu'on ne fait pas, on ne sait pas.
Tu peux aussi appliquer à la div concerné un background ET un évènement onclick :
<div style="text-align: left; height: 215px; background: url(images/imagespro/$image) no-repeat scroll center top transparent; padding: 0px;" onclick="window.location('monurl');">
Tant qu'on ne fait pas, on ne sait pas.
Un background sert uniquement à la décoration : c'est un non sens de le rendre cliquable, contraire à toute règle d'accessibilité.
Tout élément cliquable doit être dans le code html (texte ou image dotée d'un alt pertinent), et non CSS.
Tout élément cliquable doit être dans le code html (texte ou image dotée d'un alt pertinent), et non CSS.
merci a vous tous mais jais trouver une solution a mon problem.
______________________________________________________
css
#zone1 { /* la zone de lien */
float: left;
width : 100%;
height: 100%;
margin-left: 0px;
margin-top: 0px;
}
___________________________________
code de la page en php
<div style='text-align: left; height: 215px; width:auto; background: url(images/imagespro/$image)
no-repeat scroll center top transparent; padding: 0px;'><a id='zone1' href='index.php?pg=article&id_s_f=".$res['id_s_f']."&id=".$res['id']."' title='click'> <img src='promo/$promo'></div></a>
______________________________________________________
css
#zone1 { /* la zone de lien */
float: left;
width : 100%;
height: 100%;
margin-left: 0px;
margin-top: 0px;
}
___________________________________
code de la page en php
<div style='text-align: left; height: 215px; width:auto; background: url(images/imagespro/$image)
no-repeat scroll center top transparent; padding: 0px;'><a id='zone1' href='index.php?pg=article&id_s_f=".$res['id_s_f']."&id=".$res['id']."' title='click'> <img src='promo/$promo'></div></a>