I’m making a game website, and I’m using the DIV tag for the genre menu. While making the menu, I found that I am not able to set the size of the DIV elements for the menu. I’m using if that matters.
HTML:
<div class="center">
<div class="menu" onclick="location.href='all.html';">All</div>
<div class="menu" onclick="location.href='action.html';">Action</div>
<div class="menu" onclick="location.href='arcade.html';">Arcade</div>
<div class="menu" onclick="location.href='racing.html';">Racing</div>
<div class="menu" onclick="location.href='rpg.html';">PRG</div>
<div class="menu" onclick="location.href='skill.html';">Skill</div>
</div>
<div class="center">
<div class="menu" onclick="location.href='strategy.html';">Strategy/Puzzle</div>
<div class="menu" onclick="location.href='shooting.html';">Shooting</div>
<div class="menu" onclick="location.href='sports.html';">Sports</div>
<div class="menu" onclick="location.href='gamegarage.html';">GameGarage</div>
</div>
CSS:
body
{
background-color:black;
color:rgb(0,255,0);
font-family:"Comic Sans MS";
font-weight:bold;
}
.center
{
text-align:center;
}
.menu
{
font-size:1.35em;
display:inline;
width:250px;
cursor:pointer;cursor:hand;
border:5px solid #00FF00;
}
div
{
margin-bottom:15px;
}
Does anyone know what I’m doing wrong? Thanks for all the help!
try changing your CSS for your menu tag to this:
also you should change your onclick events to
window.location.href = "link"