2017-10-25 2 views
0

Also ging ich in Bootstrap 4 Docs und versuchte, einige Offset auf meinem Formular Zeilen Spalten zu implementieren, so dass es mehr zentriert ist. Es funktioniert jedoch nicht und ich bin mir nicht sicher warum. Ich habe mich nach ähnlichen Problemen umgesehen, aber wo andere Probleme eine Lösung gefunden haben, hat mein Problem nicht funktioniert. Ich habe den Offset-5 in den ersten beiden Eingabefeldern implementiert. Hier ist die Seite: https://jorgeg1105.github.io/JorgePortfolioV3/ und hier ist der Code-Schnipsel für den Bereich Ich habe Probleme mit:Probleme mit Bootstrap 4 Offset-Klasse

<div class="contact text-center"> 
 
\t \t <div class="contact_container"> 
 
\t \t \t <div class="row"> 
 
\t \t \t \t <div class="col-xl-12"> 
 
\t \t \t \t \t <h2>Want To Work Together?</h2> 
 
\t \t \t \t \t <p class="jorgeInfo">Tell me a little bit about yourself and your project. Then I will get in contact with you to schedule a time to chat. You can expect a reply within a day at most.</p> 
 
\t \t \t \t </div> 
 
\t \t \t </div><!--end row--> 
 
\t \t \t <form> 
 
\t \t \t \t <div class="form-row"> 
 
\t \t \t \t \t <div class="col-3 offset-5"> 
 
\t \t \t \t \t \t <input type="text" class="form-control" placeholder="First Name *"> 
 
\t \t \t \t \t </div><!--end col--> 
 
\t \t \t \t \t <div class="col-3 offset-5"> 
 
\t \t \t \t \t \t <input type="text" class="form-control" placeholder="Last Name *"> 
 
\t \t \t \t \t </div><!--end col--> 
 
\t \t \t \t </div><!--end row--> 
 
\t \t \t \t <div class="form-row"> 
 
\t \t \t \t \t <div class="col-3"> 
 
\t \t \t \t \t \t <input type="text" class="form-control" placeholder="Phone Number"> 
 
\t \t \t \t \t </div><!--end col--> 
 
\t \t \t \t \t <div class="col-3"> 
 
\t \t \t \t \t \t <input type="email" class="form-control" placeholder="Email *"> 
 
\t \t \t \t \t </div><!--end col--> 
 
\t \t \t \t </div><!--end row--> 
 
\t \t \t \t <div class="form-row"> 
 
\t \t \t \t \t <div class="col-3"> 
 
\t \t \t \t \t \t <input type="text" class="form-control" placeholder="What is 5+2? *"> 
 
\t \t \t \t \t </div><!--end col--> 
 
\t \t \t \t </div><!--end row--> 
 
\t \t \t \t <div class="row"> 
 
\t \t \t \t \t <div class="col-5"> 
 
\t \t \t \t \t \t <textarea class="form-control" rows="5" placeholder="Tell me a little about your project. Budget details are also appreciated."></textarea> 
 
\t \t \t \t \t </div><!--end col--> 
 
\t \t \t \t </div><!--end row--> 
 
\t \t \t \t <button type="submit" class="button">Submit</button> 
 
\t \t \t </form><!--end form--> 
 
\t \t \t <p>* Required</p> 
 
\t \t </div><!--end contact_container--> 
 
\t </div><!--end contact-->

Dank einer Tonne!

+0

Mögliches Duplikat von [Offset-Spalten funktioniert nicht (Bootstrap v4.0.0-beta)] (https://stackoverflow.com/questions/45650990/offsetting-columns-is-not-working-bootstrap-v4-0- 0-Beta) –

+0

** Bootstrap @ 4 ** ist 'Flex-Box' Design. Sie müssen nicht '.offset- * class' verwenden. Sie werden 'justify-content-end',' justify-content-between' wie folgt verwenden. Bitte überprüfen Sie den Link und lesen Sie die Dokumentation https://v4-alpha.getbootstrap.com/layout/grid/ – Rahul

+0

@Rahul dann warum ia, dass Offset Stück in der Dokumentation, wenn das ist nicht die Art, wie wir es tun sollen – Jorge

Antwort

0

Ich kann den Code nicht sehen, aber manchmal liegt es daran, dass keine neue Zeile oder Container erstellt wurde.

Das könnte man ausprobieren.

Andernfalls würde helfen, den Code abgeschnitten anzuzeigen.

Prost

+0

oh ich komplett vergessen! Ich habe den Post bearbeitet und jetzt ein Snippet hinzugefügt. Vielen Dank! – Jorge

0

Ich fand es heraus Jungs. Es stellte sich heraus, dass ich versuchte, die Offset-Klasse mit einer älteren Version von Bootstrap 4 zu benutzen, die zu der Zeit die Klasse nicht hatte. Lustig genug, die Version, die DID enthält, wurde veröffentlicht wie zwei Tage bevor ich das gepostet habe und ich meinen Bootstrap nicht aktualisiert hatte. Ich tat es jetzt, Danke für die Hilfe!