How yo make download button? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 3

How yo make download button?

21st May 2017, 8:44 AM
Roland Doctor
Roland Doctor - avatar
3 Antworten
+ 22
<a href =/image.png download=file.png><button>Download</button></a>
21st May 2017, 9:14 AM
Valen.H. ~
Valen.H. ~ - avatar
+ 14
<a href = ""> <button> download </button> </a>
21st May 2017, 8:55 AM
Maz
Maz - avatar
+ 5
You actually don't need to nest elements like that. You can just use an anchor tag and set the href to the location of the file you are downloading, and give the anchor tag a 'download' attribute. Use css to style the anchor tag. For example I like using bootstrap and the predefined styles. I'd just do something like: <a href="/images/my download.jpg" download class="btn btn-default">Download </a>
21st May 2017, 10:35 AM
Mike
Mike - avatar