Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put button in up-right corner?

How can i put a button in up-right corner? I was trying a lot of CSS things, but i really can't understand them, and they doesn't work. Can someone tell me something simple and that works? Here is HTML & CSS of my button.

HTML: < a href="#" class="myButton">green< /a>
CSS: http://www.stefanpage.ml/questions/css-1.html

Every answer is useful! :)

This is how i mean that.

like image 304
Stefan Đorđević Avatar asked Apr 25 '15 23:04

Stefan Đorđević


3 Answers

position: absolute;
top: 10px;
right: 10px;
like image 190
Verim Avatar answered Sep 19 '22 09:09

Verim


Are you looking for something like this:

.myButton {

    padding: 30px;
    display:block;
    background-color: green;
    color: white;
    text-align:center;
    position: absolute;
    top: 10px;
    right: 10px;

}

https://jsfiddle.net/6dg8nc4u/

Please mark as correct answer if that's what you are looking for.

Thanks!

like image 29
Johann Avatar answered Sep 22 '22 09:09

Johann


.myButton {
    position: fixed; /* or position: absolute; */
    top: 0;
    right: 0;
}

That is only the code for the positioning. All other styling is left out.

like image 32
Christian Lundahl Avatar answered Sep 20 '22 09:09

Christian Lundahl