BootStrap用法

1、下载:https://getbootstrap.com/

 

2. 引用到自己工程中(复制粘贴(4.3.1  css/js))

3


<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script src="vendor/bootstrap-4.3.1-dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="vendor/bootstrap-4.3.1-dist/css/bootstrap.min.css">

有的是引用的在线资源,中国在线资源 https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js

有的是本地资源(本地资源路径要注意)

4.   初级入门:

table表格关键点在class=.....

 

 

封装:

在templates下新建common/include.html     common/link.html

include.html:
 

<!--jquery-->
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<!--bootstrap-->
<script src="vendor/bootstrap-4.3.1-dist/js/bootstrap.min.js"></script>

link.html:

<link rel="stylesheet" type="text/css" href="/vendor/sweetalert/dist/sweetalert.css">
<link rel="stylesheet" type="text/css" href="/vendor/bootstrap-4.3.1-dist/css/bootstrap.css">

在html页面调用方式:用到了thymeleaf框架(SpringBoot官方推荐的框架)

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <th:block th:replace="common/include"></th:block>
    <th:block th:replace="common/link"></th:block>
</head>
<body style="text-align: center">
    <span style="font-size: 60px;">首页</span>
</body>
</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值