0

When using "position:fixed;" in my stylesheet, can I have the position also be on the right? Here's my code:

CSS

.buttons {
    margin-bottom: 30px;
    text-align: right;
    position:fixed;
}

HTML

<div id="main">
    <div class="container">
        <div class="buttons">
                <button class="nav-toggler toggle-slide-left">Menu</button>
            </div>
        </div>
    </div>
Brandroid
  • 266
  • 1
  • 2
  • 10

2 Answers2

2

Yes, you just need to add 'right: 0;' to your .buttons CSS class.

jacefarm
  • 6,747
  • 6
  • 36
  • 46
  • You're welcome. See here for further information on the CSS 'position' property - https://developer.mozilla.org/en-US/docs/Web/CSS/position. Also, please approve the answer so that the question is no longer categorized as unanswered. – jacefarm Aug 15 '14 at 13:10
1

DEMO

<div id="main">
    <div class="container">
        <div class="buttons">
                <button class="nav-toggler toggle-slide-left">Menu</button>
            </div>
        </div>
    </div>
.buttons {
    margin-bottom: 30px;
    text-align: right;
    position:fixed;
    right:0px;//add this
}
codefreaK
  • 3,584
  • 5
  • 34
  • 65