【问题标题】:Show bootstrap alert on button click单击按钮时显示引导警报
【发布时间】:2018-04-06 22:17:07
【问题描述】:

这是代码,所以任何人都可以帮助我为什么我在单击按钮时没有看到引导警报,它不会显示在页面上!

<!DOCTYPE html><html lang="en"><head><script type="text/javascript">$(document).ready(function(){
$('button').click(function(){
    $('.alert').show()
}) });</script><title>Bootstrap Example</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

.alert{显示:无;}

    </div>

    <div class="col-md-6">
            <div  style="border: 1px solid black; height: 100px;">

            </div>
             <div  style="border: 1px solid black; height: 100px;">
            </div>
        </div>


        <div class="container">
    <button>Send Message</button>
    <div class="alert alert-success alert-dismissable">
<button type="button" class="close"  data-dismiss="alert" aria-hidden="true">&times;</button>
        Success! message sent successfully.
    </div>

</div>

【问题讨论】:

  • 您为什么要更改整个问题?不要那样做,这样你之前的问题和所有的答案都会对其他人毫无用处......
  • 如果您需要其他问题的答案,请创建一个新问题。因此,请编辑您的问题以将其恢复为原始问题。

标签: html css twitter-bootstrap layout asp.net-mvc-5


【解决方案1】:

当您不提供实际代码时,这真的很难,但是......这里有一个想法,可以使用引导程序中的类来实现类似于图片中的内容:

<div class="container">
    <div class="row">
        <div class="col-md-5" style="border: 1px solid black; height: 600px;">
            content here -->
        </div>

        <div class="col-md-7">
            <div class="row">
                <div class="col-md-12" style="border: 1px solid black; height: 300px;">
                    content here -->
                </div>
            </div>
            <div class="row">

                <div class="col-md-12" style="border: 1px solid black; height: 300px;">
                    content here -->
                </div>
            </div>
        </div>
    </div>
</div>

在您指向引导文件的环境中尝试此代码,否则将完全错误。

【讨论】:

  • 上帝保佑你。
猜你喜欢
  • 2011-11-15
  • 1970-01-01
  • 2015-07-15
  • 1970-01-01
  • 2020-08-19
  • 1970-01-01
  • 2023-02-06
  • 2021-09-06
  • 1970-01-01
相关资源
最近更新 更多