Let me first tender my apologies for my question might be too long to read. But I wanted to clearly explain my problem and that’s why is the lengthy description of this question.
Please go through the codes that I have attached and please help me correct the mistakes.
I am an amateur designer who isn’t basically into web designing but I wanted to design my own page. So taking the help of Google and going through various tutorials on the internet, I have managed to design my pages. But I am stuck at this DOWNLOAD PAGE! especially with the DOWNLOAD BUTTONS.
http://dl.dropbox.com/u/20461226/download%20page.jpg
This is how I intend to have my download page. When an user hovers over any particular DOWNLOAD BUTTON of any particular edition of our magazine, the wings will open up, one at the top of the download button & the other at the bottom. And when the user clicks on the button, he/she will be able to download the compressed.RAR version of that particular magazine edition.
I learnt designing this download button from “http://designshack.net/articles/css/downloadbutton/ ”
and this is how the effect will be : “http://designshack.net/tutorialexamples/animatedDownload/index.html “
I managed to successfully build the individual download buttons for each edition, giving their exact locations in the CSS. But when I try to integrate all the buttons for the page into one html and one CSS, everything goes awry.
i.e WHEN I HOVER OVER THE 1st DOWNLOAD BUTTON, instead of the wings opening up for that particular 1st download button, the wings open up at the last button!
This is my HTML :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="button.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div class="button1">
<a href="#">Download</a>
<p class="top">Click to begin</p>
<p class="bottom">7.54 MB .RAR</p>
</div>
<body>
<div class="button2">
<a href="#">Download</a>
<p class="top">Click to begin</p>
<p class="bottom">7.8 MB .RAR</p>
</div>
<div class="button3">
<a href="#">Download</a>
<p class="top">Click to begin</p>
<p class="bottom">7.05 MB .RAR</p>
</div>
</body>
</html>
THIS IS MY CSS :
.button1 a {
display: block;
position:absolute;
left:430px;
top:410px;
height: 28px;
width: 115px;
background: #22232e;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: 0px 0px 8px rgba(0,0,0,0.2);
-moz-box-shadow: 0px 0px 8px rgba(0,0,0,0.2);
box-shadow: 0px 0px 8px rgba(0,0,0,0.2);
background: -moz-linear-gradient(top, #22232e 0%, #623043 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#22232e), color-stop(100%,#623043)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #22232e 0%,#623043 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #22232e 0%,#623043 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #22232e 0%,#623043 100%); /* IE10+ */
background: linear-gradient(top, #22232e 0%,#623043 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#22232e', endColorstr='#623043',GradientType=0 ); /* IE6-9 */
/*TYPE*/
color: white;
font: bold 11px/28px Helvetica, Verdana, sans-serif;
text-decoration: none;
text-align: center;
text-transform: uppercase;
}
p {
background: #5a8a37;
display: block;
height: 25px;
width: 105px;
margin: 0px 0 0 5px;
/*TYPE*/
text-align: center;
font: bold 10px/25px Helvetica, Verdana, sans-serif;
color: #0e1807;
/*POSITION*/
position:absolute;
left:430px;
top:410px;
z-index: -1;
/*CSS3*/
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
-moz-box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
-webkit-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
-ms-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.button1:hover .top {
margin: -23px 0 0 5px;
line-height: 25px;
}
.button1:hover .bottom {
margin: 25px 0 0 5px;
}
.button1 a:active {
background: #22232e;
background: -moz-linear-gradient(top, #22232e 0%, #623043 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#22232e), color-stop(100%,#623043)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #22232e 0%,#623043 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #22232e 0%,#623043 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #22232e 0%,#623043 100%); /* IE10+ */
background: linear-gradient(top, #22232e 0%,#623043 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#22232e', endColorstr='#623043',GradientType=0 ); /* IE6-9 */
}
/*Pulls in Wings*/
.button1:active .bottom {
margin: 25px 0 0 5px;
}
.button1:active .top {
margin: -23px 0 0 5px;
}
.button2 a {
display: block;
position:absolute;
left:632px;
top:410px;
height: 28px;
width: 115px;
background: #22232e;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: 0px 0px 8px rgba(0,0,0,0.2);
-moz-box-shadow: 0px 0px 8px rgba(0,0,0,0.2);
box-shadow: 0px 0px 8px rgba(0,0,0,0.2);
background: -moz-linear-gradient(top, #22232e 0%, #623043 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#22232e), color-stop(100%,#623043)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #22232e 0%,#623043 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #22232e 0%,#623043 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #22232e 0%,#623043 100%); /* IE10+ */
background: linear-gradient(top, #22232e 0%,#623043 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#22232e', endColorstr='#623043',GradientType=0 ); /* IE6-9 */
/*TYPE*/
color: white;
font: bold 11px/28px Helvetica, Verdana, sans-serif;
text-decoration: none;
text-align: center;
text-transform: uppercase;
}
p {
background: #5a8a37;
display: block;
height: 25px;
width: 105px;
margin: 0px 0 0 5px;
/*TYPE*/
text-align: center;
font: bold 10px/25px Helvetica, Verdana, sans-serif;
color: #0e1807;
/*POSITION*/
position:absolute;
left:632px;
top:410px;
z-index: -1;
/*CSS3*/
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
-moz-box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
-webkit-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
-ms-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.button2:hover .top {
margin: -23px 0 0 5px;
line-height: 25px;
}
.button2:hover .bottom {
margin: 25px 0 0 5px;
}
.button2 a:active {
background: #22232e;
background: -moz-linear-gradient(top, #22232e 0%, #623043 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#22232e), color-stop(100%,#623043)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #22232e 0%,#623043 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #22232e 0%,#623043 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #22232e 0%,#623043 100%); /* IE10+ */
background: linear-gradient(top, #22232e 0%,#623043 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#22232e', endColorstr='#623043',GradientType=0 ); /* IE6-9 */
}
/*Pulls in Wings*/
.button2:active .bottom {
margin: 25px 0 0 5px;
}
.button2:active .top {
margin: -23px 0 0 5px;
}
.button3 a {
display: block;
position:absolute;
left:833px;
top:410px;
height: 28px;
width: 115px;
background: #22232e;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: 0px 0px 8px rgba(0,0,0,0.2);
-moz-box-shadow: 0px 0px 8px rgba(0,0,0,0.2);
box-shadow: 0px 0px 8px rgba(0,0,0,0.2);
background: -moz-linear-gradient(top, #22232e 0%, #623043 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#22232e), color-stop(100%,#623043)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #22232e 0%,#623043 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #22232e 0%,#623043 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #22232e 0%,#623043 100%); /* IE10+ */
background: linear-gradient(top, #22232e 0%,#623043 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#22232e', endColorstr='#623043',GradientType=0 ); /* IE6-9 */
/*TYPE*/
color: white;
font: bold 11px/28px Helvetica, Verdana, sans-serif;
text-decoration: none;
text-align: center;
text-transform: uppercase;
}
p {
background: #5a8a37;
display: block;
height: 25px;
width: 105px;
margin: 0px 0 0 5px;
/*TYPE*/
text-align: center;
font: bold 10px/25px Helvetica, Verdana, sans-serif;
color: #0e1807;
/*POSITION*/
position:absolute;
left:833px;
top:410px;
z-index: -1;
/*CSS3*/
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
-moz-box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
-webkit-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
-ms-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.button3:hover .top {
margin: -23px 0 0 5px;
line-height: 25px;
}
.button3:hover .bottom {
margin: 25px 0 0 5px;
}
.button3 a:active {
background: #22232e;
background: -moz-linear-gradient(top, #22232e 0%, #623043 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#22232e), color-stop(100%,#623043)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #22232e 0%,#623043 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #22232e 0%,#623043 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #22232e 0%,#623043 100%); /* IE10+ */
background: linear-gradient(top, #22232e 0%,#623043 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#22232e', endColorstr='#623043',GradientType=0 ); /* IE6-9 */
}
/*Pulls in Wings*/
.button3:active .bottom {
margin: 25px 0 0 5px;
}
.button3:active .top {
margin: -23px 0 0 5px;
}
Please guide me and help me out where is the problem and what changes need to be done.
I shall be highly obliged 🙂
Regards
Works fine here. Why are you using different classes for the buttons? Just use
class="button"instead ofclass="button1",class="button2"andclass="button3".