【问题标题】:Why bootstrap does not work in eclipse?为什么 bootstrap 在 Eclipse 中不起作用?
【发布时间】:2017-01-22 00:39:08
【问题描述】:

为什么引导程序不起作用?我从站点下载文件夹并将其添加到 WebContent 的根目录中,例如 WebContent/bootstrap/css..js..fonts

jsp是这样的

<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet"
    href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link href='http://fonts.googleapis.com/css?family=Roboto'
    rel='stylesheet' type='text/css'>
<title>Comment Box</title>
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"
    type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

    <div class="row" id="featuresheading">
        <div class="col-lg-12">
            <div class="table-responsive">
                <table class="table ta................etc

但是为什么表格没有像它想象的那样出现?请帮忙

【问题讨论】:

  • 使用浏览器的开发工具检查是否可以加载所有引用的css和js文件。
  • @911DidBush 我遇到了类似的问题。我在开发控制台中看到我的 CSS 已加载。但是 Css 没有被渲染。有什么建议吗?

标签: java eclipse twitter-bootstrap jsp web-applications


【解决方案1】:

尝试完整发布以将引导文件导入应用服务器。
我让引导程序在 Eclipse 中的 .jsp 中工作。这是我的配置:

这是 .jsp 中的标记...

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Test Bootstrap</title>
<link href="bootstrap-3.3.6/dist/css/bootstrap.css" rel="stylesheet"
    type="text/css" />
</head>
<body>
    <div class="container">
        <h1>Test Bootstrap</h1>
        <table class="table table-striped">
            <tr>
                <td>Bootstrap</td>
            </tr>
            <tr>
                <td>is working</td>
            </tr>
        </table>
    </div>
</body>
</html>`

`您不需要两次引用引导程序。只需选择完整版或缩小版即可。祝你好运。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-03
    • 2021-09-26
    • 1970-01-01
    • 2014-08-19
    • 1970-01-01
    • 2021-11-24
    相关资源
    最近更新 更多