我看不到我是否缺少 div,或者我做错了什么。我没有可能导致这种情况的绝对甚至相对定位
所以模态看起来像:
<div class="modal fade" id="{{ 'editPost' . removeSpaces($post->title) }}" tabindex="-1" role="dialog" aria-labelledby="{{ 'editPost' . removeSpaces($post->title) }}">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="editPost">Edit {{ $post->title }}</h4>
</div>
<div class="modal-body">
@include('blog.posts.edit', ['postToEdit' => $post])
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
include
好的,到目前为止,我们看起来一切都很好......
{{ Form::open(array('url' => array('edit-post', $postToEdit->title), 'class' => 'form-horizontal')) }}
<div class="form-group">
{{ Form::label('title', 'Post Title', array('class' => 'col-sm-2 control-label')) }}
<div class="col-sm-10">
{{ Form::text('title', $postToEdit->title, array('placeholder' => 'sample title', 'class' => 'form-control')) }}
</div>
</div>
<div class="form-group">
{{ Form::label('content', 'Post Content', array('class' => 'col-sm-2 control-label')) }}
<div class="col-sm-10">
{{ Form::textarea('content', convertToMarkdown($postToEdit->content), array('placeholder' => 'some content', 'class' => 'form-control')) }}
</div>
</div>
<div class="form-group">
{{ Form::label('tags', 'Post Tags', array('class' => 'col-sm-2 control-label')) }}
<div class="col-sm-10">
{{ Form::text('tags', '', array('class' => 'form-control', 'data-role' => 'tagsinput')) }}
</div>
</div>
<div class="form-group">
{{ Form::label('categories', 'Post Categories', array('class' => 'col-sm-2 control-label')) }}
<div class="col-sm-10">
{{ Form::text('categories', '', array('class' => 'form-control', 'data-role' => 'tagsinput')) }}
</div>
</div>
{{ Form::hidden('blogId', $blog->id) }}
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
{{ Form::submit('Create', array('class' => 'btn btn-primary')) }}
</div>
</div>
{{ Form::close() }}
这就是问题所在。所有这些form-group
div 都在form
标签之外。除了会导致以下情况的默认引导 css 之外,没有 css:
[
什么会导致这个
我试过查看表单的计算属性,它的元素没有什么突出的。再次没有绝对定位。这都是标准的引导爵士乐。
即使我删除了表单元素中的所有标签并放入hello world
其中,它仍然出现在表单之外......甚至<form> hello world</form>
显示hello world
在表单标签之外