Ich arbeite gerade an meiner neuen Website (Rails, SASS) und ich brauche deine Hilfe mit meinem CSS.Wie zeige ich einen Text auf dem Bild an?
Ich habe ein paar Bilder von meinen Projekten. Ich möchte keinen Text auf Bildern, nur wenn img: hover => dieser Text angezeigt werden soll.
Ich habe das versucht, aber ich habe keinen Text auf Bild Hover angezeigt.
<div class="bodyprojet">
<% @Projets.limit(15).in_groups_of(3, false).each do |group| %>
<div class="row">
<% group.each do |projet| %>
<div class="col-sm-6 col-md-4">
<a href="<%= projet_path(projet.slug) %>">
<div class="thumbnail">
<p class="text">Voir</p>
<img src="<%= projet.image.url(:thumb) %>" alt="<% projet.title %>">
</div>
</a>
</div>
<% end %>
</div>
<% end %>
</div>
Hier ist meine CSS (SASS):
.bodyprojet {
padding:0;
margin: 0;
.row {
margin: 0 !important;
padding: 0 !important;
.col-md-4.col-sm-6 {
padding:0px 5px 0px 5px;
margin: 0;
}
}
a {
border:none !important;
text-decoration: none !important;
color:#000000 !important;
}
.thumbnail {
border:none !important;
background: #FFED00;
padding:0 !important;
position: relative;
img {
min-height: 100%;
display: block;
min-width: 100%;
opacity: 1;
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
&:hover {
opacity: .2;
}
}
p.text {
position: absolute;
left:50%;
top:50%;
color:#979797;
opacity: 0;
font-size: 30px;
}
img:hover p.text {
color:#000;
opacity: 1;
}
}
}
Ich habe keinen Titel auf das Bild, ich will ein Text angezeigt, wenn img: schweben. –
@Florian_CEO können Sie bitte Bild oder Beispiel postulieren, was excatly Sie wollen –