2016-03-02 114 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