Did you checked Bootstrap form classes?
<div class="form-group col-md-12">
{{ Form::textarea('comment', null, ['placeholder' => 'Your Comment', 'class' => 'form-control' , 'cols' => 20, 'rows' =>10, 'required' => '']) }}
</div>
am working on a comment system of a blog using twitter bootstrap 3 and Laravel. I have inserted a textarea on the form using Laravel form helpers. I have programmed such that when the user enters a comment it is displayed above the form(just like facebook or youtube comment system). Now the problem is the comment breaks out of its div and parent div and spans across the entire screen. I need assistance to make it remain inside the Div
The code below is of the form
<div class="leave-coment-form">
{{ Form::open(['route' => ['comments.store' , $post->id], 'method' => 'POST' , 'data-parsley-validate' => '']) }}
{{ Form::text('name', null, ['placeholder' => 'Name', 'class' => 'form-control' , 'required' => '', 'maxlength' => "20" ]) }} <br>
{{ Form::text('email', null, ['placeholder' => 'Email', 'class' => 'form-control' , 'required' => '' , 'data-parsley-type' => 'email']) }} <br>
{{ Form::textarea('comment', null, ['placeholder' => 'Your Comment', 'class' => 'form-control' , 'cols' => 20, 'rows' =>10, 'required' => '', 'maxlength' => "400"]) }}
{{ Form::submit('Submit Comment', ['class' => 'btn btn-success btn-block', 'style' => 'margin-top:15px; margin-bottom:15px;']) }}
{{ Form::close() }}
</div>
The code below is of the comment section that shows the comments above the form
<div class="comments">
<h3 class="comments-title"><span class="glyphicon glyphicon-comment"></span> {{ $post->comments()->count()}} Comments</h3>
@foreach($post->comments as $comment)
<div class="comment col-md-12">
<div class="author-info">
<img src="{{ 'https://www.gravatar.com/avatar/'.md5(strtolower(trim($comment->email))).'?s=50d=mm' }}" class="author-image">
<div class="author-name">
<h4> {{ $comment->name }} </h4>
<p class="author-time">{{ date('F nS, Y-g:iA', strtotime($comment->created_at))}} </p>
</div>
</div>
<div class="comment-content">
{{ $comment->comment }}
</div>
</div>
@endforeach
</div>
CSS code
.leave-coment-form textarea{
min-height:200px;
resize:none;
width:100% !important;
margin:1em 0 0.8em;
}
/*////////// Comments section above the form ////////////////////*/
.comments{
max-width: 100%;
}
.comment{
margin-bottom: 45px;
margin-top: 30px;
}
.author-image{
float:left;
width: 50px;
height: 50px;
border-radius:50%;
}
.author-name{
margin-left: 60px;
}
.author-time{
font-size: 14px;
font-style: italic;
color: #aaa;
}
textarea{
max-width: 100%;
}
.comment-content{
margin-left: 60px;
font-size: 16px;
line-height: 1.5em;
resize:none;
max-width:100% !important;
}
Please or to participate in this conversation.