MFCS
MFCS

Reputation: 429

Aligning two divs beneath each other? rails

I have these two button divs which I want to align right under each other, with some 10px margin between each other. Here is the code, no point with claptrap.

<div id = "buttons">

      <div id = "signin-button">
      <%= link_to "Sign In", new_user_session_path, :id => "SignInText" %>
    </div>

    <div id = "signup-button">
      <%= link_to "Sign Up", new_user_registration_path, :id => "SignUpText" %>
    </div>

  </div>

Upvotes: 0

Views: 1090

Answers (2)

Morpheus
Morpheus

Reputation: 9065

Some css and you done:

#signin-button,
#signup-button
{
  float: right;
  margin-bottom: 10px;
}

And change your divs to use class instead of id.

Upvotes: 3

sjain
sjain

Reputation: 23344

The two divs can be aligned beneath each other with this css -

 #signin-button,#signup-button{ display : inline position:absolute;margin-bottom: 10px; }

Upvotes: 0

Related Questions