Arif YILMAZ
Arif YILMAZ

Reputation: 5866

clear a link's css properties in html

I have bought a html+css template from a website and I am having a problem with a link.

I am trying to add a link and link gets a lot of css properties by default. How can I clear those css properties for that specific link? here is the code below...

<div class="popup-gallery">
    <span href="img/portfolio/01.jpg" class="image-item">
          <img src="img/portfolio/01.jpg" alt="">
          <div class="item-overlay">
            <h4>Test asd asd</h4>
            <div>zxc zxc zxc zxc zxc zxc zxc zxc zxc zxc zxc</div>
            <div><br /></div>
            <div><a href="/fiyat_listeleri/fiyat.pdf">Fiyat Listesi*******</a></div>
          </div>
        </span> 
</div>

The link with the PDf, I want it to be downloaded when it is clicked, but it opens it as a popup modal. I have used target="_blank" but it didn't work.

How can I make it downloadable?

Upvotes: 1

Views: 85

Answers (2)

Jon
Jon

Reputation: 636

What about adding download to the tag?

<a href="/fiyat_listeleri/fiyat.pdf" download>Fiyat Listesi*******</a>

The idea is from w3schools.

Demo:

http://jsfiddle.net/5oafzty8/

Upvotes: 4

Stewartside
Stewartside

Reputation: 20905

Firstly, the css styling which you have requested to be removed.

Add this to your stylesheet file.

.popup-gallery span .item-overlay div a {
    color: #000000; // or whatever color
    text-decoration: none;
    // add any more styles you want
}

For the link, im guessing there's JavaScript doing that so you just need to disable whatever is currently running.

In jQuery:

$(document).ready(function() {
  $('.popup-gallery span .item-overlay div a').click(function(e) {
    e.preventDefault();
  });
});

Upvotes: 5

Related Questions