2016-03-02 77 views
0

當我試圖將按鈕置於左下方時,它可以工作,但是當我轉到其中一個按鈕並返回時,它的所有按鈕都有一個按鈕?另外一個,我需要向下滾動才能看到請幫忙CSS如何定位圖像右下角

HTML

<!Doctype html> 
<html> 
    <head> 
    <title>Forsaken </title> 
    <link href="main.css" rel="stlesheet" type="text/css"> 
    </head> 

    <body> 


    <a href="teams.html"><button><img class="#topleft" src="icon1.jpg " width="100%" alt="Teams" ></button></a> 
    <a href="store.html"><button><img class="#topright" src="icon2.jpg " width="100%" alt="store" ></button></a> 
    <a href="sponsors.html"><button><img class="#bottomleft" src="icon4.jpg " width="100%" alt="sponsors" ></button></a> 
    <a href="aboutus.html"><button><img class="#bottomright" src="icon3.jpg " width="100%" alt="aboutus" ></button></a> 


</body> 


</html> 

CSS

#topleft { 
    position: fixed; 
    top: 0px; 
    left: 0px; 
} 

#topright { 
    position: fixed; 
    top: 0px; 
    right: 0px; 
} 

#left { 
    position: fixed; 
    left: 0px; 
} 

#right { 
    position: fixed; 
    right: 0px; 
} 


div { 
    border-style:solid; 
    border-width:0px; 
    border-color:#000000; 
} 

#yes { 
    border: none; 
    padding: 0; 
    background: none; 
} 

.flat { 
    border: none; 
    background: #222; 
    color: #FFF; 
    padding: 0px 0px; 
    font-size: 22px; 
    font-family: Palatino; 
    font-weight: bold; 
} 

.lighter { 
    background: #666; 
} 

#no { 
    border: none; 
    padding: 0; 
    background: none; 
} 

.flat { 
    border: none; 
    background: #222; 
    color: #FFF; 
    padding: 0px 0px; 
    font-size: 22px; 
    font-family: Palatino; 
    font-weight: bold; 
} 

.lighter { 
    background: #666; 
} 

PS其他所有的按鈕都工作,但關於我們一個。

+1

你不必爲#bottomright和#bottomleft任何CSS?你的代碼也試圖做怪異的事情,所以我建議查找一些教程。 –

+0

爲什麼你使用''標籤裏面的按鈕 –

+0

#bottomright'和'#bottomleft' css –

回答

0

從改變你的代碼:

#left { 
position: fixed; 
left: 0px; 
} 

#right { 
position: fixed; 
right: 0px; 
} 

.bottomleft{ 
position: fixed; 
left: 0px; 
} 

.bottomright{ 
position: fixed; 
right: 0px; 
} 

希望它可以幫助

+0

html http ://pastebin.com/nkhVjsRY css http://pastebin.com/q9fqYsWi我有新的代碼請檢查出來,他們兩個仍然不工作感謝您的幫助 – CreepyC

+0

@CreepyC採取您的網頁的屏幕截圖,和將其粘貼到某個位置,以便了解當前情況。 – Jogi

+0

http://stackoverflow.com/questions/35740350/how-do-i-position-button-to-the-bottom-right-using-css/35741410?noredirect=1#comment59203116_35741410 – CreepyC