Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

media-right not correctly positioned #15051

Closed
myhandeu opened this issue Nov 8, 2014 · 5 comments
Closed

media-right not correctly positioned #15051

myhandeu opened this issue Nov 8, 2014 · 5 comments
Labels

Comments

@myhandeu
Copy link

myhandeu commented Nov 8, 2014

Hi, I just migrate from bootstrap 3.2.0 into bootstrap 3.3.0. I had a problem in media class. The idea to change media structure is good. But unfortunately when I use media-right with short content in media-body there is a gap on the right side of media-right.

Here's the illustration:
gap
The button follow should not be positioned on there. I just change margin of media and padding of .media-left and .media-right.

Here's the html code:

<div class="media">
  <a class="media-left" href="#">
    <img class="img-sm img-circle" src="assets/img/u_7_sm.jpg" alt="alt here">
  </a>
  <div class="media-body">
    <div class="media-heading">
      <a href="#">Marshall Dean</a> / @fl_mdean
    </div>
    <div class="media-desc">
      Gingerbread dragée macaroon cotton candy
    </div>
    <div class="media-info">
      Join over 5y ago
    </div>
  </div>
  <div class="media-right">
    <button type="submit" class="btn btn-sm btn-simple btn-info">Follow</button>
  </div>
</div>

The question is this is bug of media? Or I forget something?

Thank you

@hnrch02 hnrch02 added the css label Nov 8, 2014
@hnrch02
Copy link
Collaborator

hnrch02 commented Nov 8, 2014

I think this basically boils down to the problem described in #14990. Does applying width: 100%; to .media-body fix your problem?

@myhandeu
Copy link
Author

myhandeu commented Nov 8, 2014

Yes that fix my problem I tried before. But unfortunately when media placed inside wrapper that contain float left or right, it pull the wrapper to fill entire width and caused other float wrapper below the wrapper that contain media. Any solution for this case?

@myhandeu
Copy link
Author

myhandeu commented Nov 8, 2014

Hi, I just solve this problem by adding .media-inline class. The purpose of .media-inline class is to prevent media push the wrapper to fit entire float box. Here's the code:

.media-body {
  width: 100%;

  .media-inline & {
    width: auto;
  }
}

Hope this code will help someone.

Thank you

@myhandeu myhandeu closed this as completed Nov 8, 2014
@brunsgaard
Copy link

@myhandeu helped me :)

@alosultan
Copy link

.pull-left + .media-body, .pull-right + .media-body {
    display: block;
    overflow: hidden;
    zoom: 1;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants