首先讓我對我的問題表示歉意,因爲我的問題可能太長而無法閱讀。但我想清楚地解釋我的問題,這就是爲什麼這個問題的冗長描述。 請仔細閱讀我附上的代碼,並幫助我糾正錯誤。爲什麼懸停在一個影響其他CSS元素的CSS上?
我是一個業餘設計師誰基本上沒有進入網頁設計,但我想設計自己的網頁。所以藉助谷歌的幫助,並通過互聯網上的各種教程,我設法設計了我的網頁。但我被困在這個下載頁面!特別是使用下載按鈕。
http://dl.dropbox.com/u/20461226/download%20page.jpg
這是我打算讓我的下載頁面。當用戶懸停在我們雜誌的任何特定版本的任何特定下載按鈕上時,機翼將打開,一個在下載按鈕&的頂部,另一個在底部。當用戶點擊按鈕時,他/她將能夠下載該特定雜誌版本的壓縮.RAR版本。 我學會了從設計「http://designshack.net/articles/css/downloadbutton/」 此下載按鈕,這就是效果將會如何:「http://designshack.net/tutorialexamples/animatedDownload/index.html」
我設法成功打造個人下載每個版本的按鈕,在CSS中給出它們的確切位置。但是,當我嘗試將頁面的所有按鈕集成到一個HTML和一個CSS中時,一切都會出錯。 也就是說,當我在第一個下載按鈕之上擺弄時,而不是第一個下載按鈕打開的翅膀,翅膀在最後一個按鈕處打開!
這是我的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;
}
請指導我,幫助我哪裏出了問題,需要做什麼樣的變化。 我將非常有義務:) Regards
在我將HTML和CSS渲染到腦海之前,您可以上傳一個現場演示嗎? – Blender
好吧,讓我試試上傳這個頁面的演示。我很快就會回到這個鏈接。 –