2016-07-23 73 views
-2

我是这个领域的新手,并试图创建一个模态。我发现这种模式:http://drublic.github.io/css-modal/#howto 但无法理解哪些文件包含在我的网页中。我看到有很多不同的文件(SCSS,CSS和JS)以及其他许多文件。 在编写标记和开始分配任务之前,我应该包含哪些文件?如何创建模态

+0

为什么有downvotes?我不明白这个社区! – Husanoo

+0

由于您没有提供任何代码,因此存在降价提示,这意味着问题要么非常模糊,要么期待会员为您编写代码,而不是这样。有一个在这里阅读有关创建好问题:http://stackoverflow.com/help/mcve – Toby

+0

我认为应该留下这些问题中的一些,因为有很多新手谁不知道如何包含文件和在哪里,地狱,当我从其他地方窃取代码时,我仍然有时会挣扎:-) –

回答

0

您可以使用Bootstrap模态。他们是灵活,最低功能要求..

 <button class="btn btn-primary" data-toggle="modal" data-target=".bd-example-modal-lg">Large modal</button> 

<div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true"> 
    <div class="modal-dialog modal-lg"> 
    <div class="modal-content"> 
     <div class="modal-header"> 
     <button type="button" class="close" data-dismiss="modal" aria-label="Close"> 
      <span aria-hidden="true">&times;</span> 
     </button> 
     <h4 class="modal-title">Modal title</h4> 
     </div> 
     <div class="modal-body"> 
     <p>One fine body&hellip;</p> 
     </div> 
     <div class="modal-footer"> 
     <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> 
     <button type="button" class="btn btn-primary">Save changes</button> 
     </div> 
    </div> 
    </div> 
</div> 

必需的CSS和JS文件在的jsfiddle的外部资源链接可

您可以找到Here及以下更多的帮助和信息一个工作的例子。

Fiddle Example