with HTML CSS , when clicking on picture the modal will open(picture is link)
but here i have to define #id in href of my a tag,
but there is many picture that has modal! and here i have to define many href id in my css for every pictures
what is your opinion for fix this problem?
Can tou give us an example? I'm afraid the explanation isn't clear enough
all of these images are link <a> <img></a> so when i clicking to them should modal open, and the <a> tag have id for modal like this code section <a href = "#popup"><img src = "images/amirreza.jpg" class = "card" alt="amirreza pic"/></a> <div id = "popup"> and the problem is " id and href here are unic for each picture " so i have to define more id and different id in CSS for any modal picture, but i dont want do this, is there any idea for fix this?
i think there is no solution for this, i have to make more #id 🤦♂️
find how the modal/popup is launched and replicate the same with JS i.e. on click on any of your a tags, execute the popup open logic. but your solution still is fine since you opted to spend your time duplicating HTML (as it can be done using <template> and a little of JS)
so the solution is JS... and what is <template> i searching for this and i can't find have you any article about this?
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template
Обсуждают сегодня