antiblock
diamwall
  • Chatbox

    You don't have permission to chat.
    Load More
Sign in to follow this  
xavier1400

Adicionar href a uma imagem

5 posts in this topic

Boas, eu tenho o seguinte código:
https://jsfiddle.net/nvuc4nnc/2/
Como podem reparar coloquei um href na imagem para um link, só que se repararem a imagem só dá para clicar na margem direita da mesma, alguém me consegue ajudar?

Share this post


Link to post
Share on other sites
antiblock
Elveron

Não tem problema nenhum... corre-o no teu próprio host em vez de no jsfiddle.

Share this post


Link to post
Share on other sites
13 minutos atrás, Cσяvσ⋆ disse:

Não tem problema nenhum... corre-o no teu próprio host em vez de no jsfiddle.

Não tem problema? o.o A imagem toda é clicável? só consigo clicar na margem direita

Share this post


Link to post
Share on other sites
10 horas atrás, xavier1400 disse:

Não tem problema? o.o A imagem toda é clicável? só consigo clicar na margem direita

Na classe nome_ep2 retira a seguinte linha "position: relative;" e o teu problema ficará resolvido.

 

HTML

	<div class="episodios_tras5">
		<div class="episodios">
			<a href="https://habitosdosucesso.net/wp-content/uploads/2015/03/seguir-exemplo-2-1.jpg">
				<img src="https://habitosdosucesso.net/wp-content/uploads/2015/03/seguir-exemplo-2-1.jpg" alt="" width="300" height="289" class="alignnone size-medium wp-image-139" />
			</a>
		</div>
		<div class="nome_ep2">
			<a href="http://localhost/wordpress/?page_id=236">Temporada 1 Episódio 1</a>
		</div>
	</div>

CSS

.episodios_tras5 {
    display: block;
    float: left;
    width: 270px;
    height: 100%;
    margin: 10px;
    margin-left: 6%;
    height: 7.31707%;
    top: 12.1951%;
    color: #FFF;
}
.episodios {

    display: block;
    float: left;
    height: 300px;
	width:300px;
    top: 12.1951%;
    color: #FFF;
}
.nome_ep2 {
    display: block;
    height: 100%;
    color: #FFF;
	text-align: center;
}

440.png

Share this post


Link to post
Share on other sites
1 hora atrás, Albert Einstein disse:

Na classe nome_ep2 retira a seguinte linha "position: relative;" e o teu problema ficará resolvido.

 

HTML


	<div class="episodios_tras5">
		<div class="episodios">
			<a href="https://habitosdosucesso.net/wp-content/uploads/2015/03/seguir-exemplo-2-1.jpg">
				<img src="https://habitosdosucesso.net/wp-content/uploads/2015/03/seguir-exemplo-2-1.jpg" alt="" width="300" height="289" class="alignnone size-medium wp-image-139" />
			</a>
		</div>
		<div class="nome_ep2">
			<a href="http://localhost/wordpress/?page_id=236">Temporada 1 Episódio 1</a>
		</div>
	</div>

CSS


.episodios_tras5 {
    display: block;
    float: left;
    width: 270px;
    height: 100%;
    margin: 10px;
    margin-left: 6%;
    height: 7.31707%;
    top: 12.1951%;
    color: #FFF;
}
.episodios {

    display: block;
    float: left;
    height: 300px;
	width:300px;
    top: 12.1951%;
    color: #FFF;
}
.nome_ep2 {
    display: block;
    height: 100%;
    color: #FFF;
	text-align: center;
}

440.png

 

Obrigado pela ajuda, problema resolvido !

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this