div rechts ausrichten in Bootstrap 3

Gibt es eine Möglichkeit in Bootstrap 3, um ein div rechts ausrichten?

Ich bin mir der Offset-Möglichkeiten bewusst, aber ich möchte ein formatiertes Div rechts von seinem Container ausrichten, während es in einer mobilen Ansicht mit voller Breite zentriert sein sollte. Die Klasse 'pull-right' funktioniert nicht mehr. Haben sie vergessen, es zu ersetzen, oder übersehe ich etwas offensichtlich?

<div class="row">
  <div class="container">
    <div class="col-md-4">
      left content
    </div>
    <div class="col-md-4 col-md-offset-4">
      <!-- The next div has a background color and its own paddings and should be aligned right-->
      <!-- It is now in the right column but aligned left in that column -->
      <div class="yellow_background">right content</div>
    </div>
  </div>
</div>

Sicher weiß ich, wie man das in CSS macht, aber kann man das auch in Bootstrap 3 machen?

Die Klasse pull-right ist in Bootstrap 3 noch vorhanden Siehe die 'Hilfsklassen' hier

pull-right ist definiert durch

.pull-right {
  float: right !important;
}

ohne weitere Informationen über Stile und Inhalte ist es schwer zu sagen.

Es zieht definitiv rechts in diesem JSBIN wenn die Seite breiter als 990px ist - das ist, wenn die col-md Styling tritt in, Bootstrap 3 wird mobile erste und alle.

Kommentare (0)

Meinen Sie so etwas wie dies:

HTML

<div class="row">
  <div class="container">

    <div class="col-md-4">
      left content
    </div>

    <div class="col-md-4 col-md-offset-4">

      <div class="yellow-background">
        text
        <div class="pull-right">right content</div>  
      </div>

    </div>
  </div>
</div>

CSS

.yellow-background {
  background: blue;
}

.pull-right {
  background: yellow;
}

Ein vollständiges Beispiel finden Sie auf Codepen.

Kommentare (0)

ich denke, du versuchst, den Inhalt innerhalb des div nach rechts auszurichten, das div mit Offset schiebt sich bereits nach rechts, hier etwas Code und LIVE-Beispiel:
FYI: .pull-right schiebt nur das div nach rechts, aber nicht den Inhalt innerhalb des div.

HTML:

<div class="row">
  <div class="container">
    <div class="col-md-4 someclass">
      left content
    </div>
    <div class="col-md-4 col-md-offset-4 someclass">
      <div class="yellow_background totheright">right content</div>
    </div>
  </div>
</div>

CSS:

.someclass{ /*this class for testing purpose only*/
    border:1px solid blue;
    line-height:2em;
}

.totheright{ /*this will align the text to the right*/
  text-align:right;
}

.yellow_background{
    background-color:yellow;
}

Eine weitere Änderung:

...
<div class="yellow_background totheright">
  <span>right content</span>
  <br/>image also align-right<br/>

</div>
...

Ich hoffe, dass sie Ihr Problem lösen wird

Kommentare (0)