Skip to content

Instantly share code, notes, and snippets.

@CN-CODEGOD
Created January 5, 2025 11:43
Show Gist options
  • Save CN-CODEGOD/cec236fd6114c49022c5f176e2bb0ac2 to your computer and use it in GitHub Desktop.
Save CN-CODEGOD/cec236fd6114c49022c5f176e2bb0ac2 to your computer and use it in GitHub Desktop.
html 常用modules 导入方法
description:
因为常常写html,需要导入bootstrap,tailwind,所以写一个gist总结方法
#jQuery,cdn
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
#
bootstap ,cdn
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
#tailwind
npm install -D tailwindcss
npx tailwindcss init
创建一个css文件,input.css
@tailwind base;
@tailwind components;
@tailwind utilities;
POWERSHELL> npx tailwindcss -i ./src/input.css -o ./src/output.css --watch
#import
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" , href="./output.css>
#导入json
#在taiwind.config.js
#添加html文件
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./*.html'],
theme: {
extend: {},
},
plugins: [],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment