Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
justify-content
flex-start
flex-end
center
space-around
space-between
space-evenly
A
B
C
css
@import url("https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@400;500&family=Space+Mono:wght@400;700&display=swap"); * { box-sizing: border-box; } body { background-color: #232931; font-family: "Josefin Sans", sans-serif; } .wrapper { height: 100vh; display: -webkit-box; display: flex; } .scene { height: 100vh; margin-bottom: 140vh; } .container { display: -webkit-box; display: flex; flex-wrap: wrap; height: 50vh; width: 50vh; flex-shrink: 0; background-color: #3a4750; border-radius: 2vh; margin: auto auto 12vh; padding: 1vh; } .box { width: 18%; height: 18%; color: #fff; flex-shrink: 0; font-size: 3vh; padding: 1vh; } .inner { width: 100%; display: -webkit-inline-box; display: inline-flex; -webkit-box-align: center; align-items: center; height: 100%; -webkit-box-pack: center; justify-content: center; border-radius: 1.2vh; background-color: rgba(255, 255, 255, 0.1); } .header { position: absolute; height: 35vh; left: 0; top: 0; width: 100%; display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; -webkit-box-pack: center; justify-content: center; -webkit-box-orient: vertical; -webkit-box-direction: normal; flex-direction: column; } .title { color: #fff; font-size: 6vh; display: -webkit-box; display: flex; font-weight: 700; margin-bottom: 2vh; } .properties { color: #f6c90e; display: -webkit-box; display: flex; flex-wrap: wrap; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; max-width: 58vh; } .property { padding: 1vh 2vh; background-color: rgba(246, 201, 14, 0.1); margin: 0.6vh; border-radius: 0.6vh; font-family: "Space Mono"; font-size: 1.8vh; cursor: pointer; } .property--active { padding: 1vh 2vh; background-color: #f6c90e; color: #232931; margin: 0.6vh; border-radius: 0.6vh; font-family: "Space Mono"; font-size: 1.8vh; cursor: pointer; -webkit-transition: 0.2s; transition: 0.2s; }
JavaScript
const prop = { start: ".start", end: ".end", center: ".center", between: ".between", around: ".around", evenly: ".evenly", all: ".property" }; const timeline = gsap.timeline({}); timeline // flex-start .set(prop.all, { className: "property" }, prop.start) .to(prop.start, { className: "property--active" }, prop.start) .add("start") // flex-end .to(prop.all, { className: "property" }, prop.end) .to(prop.end, { className: "property--active" }, prop.end) .to( ".box--a", { duration: 1, marginLeft: "46%", ease: "expo.out" }, prop.end ) .add("end") // center .to(prop.all, { className: "property" }, prop.center) .to(prop.center, { className: "property--active" }, prop.center) .to( ".box--a", { duration: 1, marginLeft: "23%", ease: "expo.out" }, prop.center ) .add("center") // space-around .to(prop.all, { className: "property" }, prop.around) .to(prop.around, { className: "property--active" }, prop.around) .to( ".box--a", { marginLeft: "7.7%", duration: 1, marginRight: "0", ease: "expo.out" }, prop.around ) .to( ".box--b", { duration: 1, marginRight: "15.25%", marginLeft: "15.25%", ease: "expo.out" }, prop.around ) .add("around") // space-between .to(prop.all, { className: "property" }, prop.between) .to(prop.between, { className: "property--active" }, prop.between) .to( ".box--a", { duration: 1, marginLeft: "0", marginRight: "23%", ease: "expo.out" }, prop.between ) .to( ".box--b", { duration: 1, marginLeft: "0", marginRight: "23%", ease: "expo.out" }, prop.between ) .add("between") // space-evenly .to(prop.all, { className: "property" }, prop.evenly) .to(prop.evenly, { className: "property--active" }, prop.evenly) .to( ".box--a", { marginLeft: "11.5%", duration: 1, marginRight: "0", ease: "expo.out" }, prop.evenly ) .to( ".box--b", { duration: 1, marginRight: "11.5%", marginLeft: "11.5%", ease: "expo.out" }, prop.evenly ) .add("evenly"); const propNodes = document.querySelectorAll(".property"); propNodes.forEach((p) => { p.addEventListener("click", (e) => { const type = e.target.getAttribute("data-type"); timeline.pause(type); }); });
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>在CSS中调整内容属性-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号