In: Computer Science
In this weeks assignment you will creating some character cards on a web page. These character cards can be similar to a baseball card, Magic The Gathering Card. It is your choice and anything is fair game.
Requirements:
ANSWER:
<html>
<head>
<style>
body {
font-family: system-ui;
background: #f2f2f2;
}
h1 {
font-size: 24px;
padding: 10px 0;
border: 2px solid transparent;
/ border image /
border-image:
url("https://www.freepngimg.com/thumb/pokemon/20708-7-pokeball-hd-thumb.png")
20% round;
}
#cards {
display: flex;
flex-wrap: wrap;
}
.card {
width: 320px;
border: 1px solid #eee;
background-color: #fff;
margin: 10px;
background-position: 75px 100px;
text-align: center;
border-radius: 4px;
padding: 15px 10px;
}
p {
font-size: 15px;
}
.traits {
display: flex;
justify-content: space-around;
}
.traits > div {
padding: 10px 15px;
border-radius: 8px;
background-color: #e62121;
color: #fff;
}
.traits > div p {
font-size: 13px;
margin-bottom: 0;
}
.traits > div h3 {
margin: 10px 0;
font-size: 18px;
}
.shadow {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
</style>
</head>
<body>
<h1 align="center">Pokemon Cards</h1>
<div id="cards">
<div class="card">
<h2>Pikachu</h2>
<img
align="center"
src="https://www.freepngimg.com/thumb/pokemon/37444-9-pikachu-file-thumb.png"
/>
<p>
Pikachu is an electric type pokemon. It evolves from Pichu
when
leveled up with high friendship and evolves into Raichu when
exposed
to a Thunder Stone. It has a Gigantamax form.
</p>
<div class="traits">
<div>
<p>Element</p>
<h3>Electric</h3>
</div>
<div>
<p>Height</p>
<h3>40.6</h3>
</div>
<div>
<p>Weakness</p>
<h3>Ground</h3>
</div>
</div>
</div>
<div class="card">
<h2>Charmander</h2>
<img
align="center"
src="https://www.freepngimg.com/thumb/pokemon/37543-2-pokemon-picture-thumb.png"
/>
<p>
Charmander is a Fire-type, reptilian Pokémon with a primarily
orange
body and blue eyes. It evolves into Charmeleon starting at level
16,
which evolves into Charizard starting at level 36.
</p>
<div class="traits">
<div>
<p>Element</p>
<h3>Fire</h3>
</div>
<div>
<p>Height</p>
<h3>61cm</h3>
</div>
<div>
<p>Weakness</p>
<h3>Water</h3>
</div>
</div>
</div>
<div class="card">
<h2>Munchlax</h2>
<img
align="center"
src="https://www.freepngimg.com/thumb/pokemon/20597-8-pokemon-image-thumb.png"
/>
<p>
Munchlax is a Normal-type Baby Pokémon introduced in Generation IV.
It
is known for its very high appetite and eats anything edible
except
for Pokémon and humans.
</p>
<div class="traits">
<div>
<p>Element</p>
<h3>Normal</h3>
</div>
<div>
<p>Height</p>
<h3>61cm</h3>
</div>
<div>
<p>Weakness</p>
<h3>Fighting</h3>
</div>
</div>
</div>
</div>
<script>
// Get All Card Elements
const cards = document.getElementsByClassName("card");
// Add a class to all elements
for (let i = 0; i < cards.length; i++)
cards[i].classList.add("shadow");
// Add the link
const link = document.createElement("a");
link.setAttribute("href", "https://pokemon.com"); // set href
link.innerText = "Pokemon Website"; // set link text
document.body.appendChild(link); // add it to the body
</script>
</body>
</html>
If you do not get anything in this solution,please put a comment and i will help you out.
Do not give a downvote instantly.It is a humble request.
If you like my answer,please give an upvote.....Thank you.