css布局实现简单五线谱效果代码
代码语言:html
所属分类:布局界面
代码描述:css布局实现简单五线谱效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { padding: 5em; } .bar { position: relative; display: inline-block; width: 12px; height: 32px; margin: 0 12px; margin-bottom: 48px; width: 2px; border-right: 1px solid black; } .debug .bar { outline: 1px solid rgba(255, 0, 0, 0.1); } .bar.double, .bar.end { border-left: 1px solid black; } .bar.end { float: right; border-right-width: 4px; margin-right: 0; } .staff { font-size: 0; background-image: linear-gradient(180deg, #999 0, #999 1px, transparent 1px, transparent 8px, #999 8px, #999 9px, transparent 9px, transparent 16px, #999 16px, #999 17px, transparent 17px, transparent 24px, #999 24px, #999 25px, transparent 25px, transparent 32px, #999 32px, #999 33px, transparent 33px); background-size: 100% 80px; } .staff.debug { background-color: rgba(0, 255, 0, 0.1); } .note { position: relative; display: inline-block; width: 12px; height: 32px; margin: 0 12px; margin-bottom: 48px; } .debug .note { outline: 1px solid rgba(255, 0, 0, 0.1); } .note::before { height: 8px; width: 12px; } .whole.note::before { position: absolute; content: ""; box-sizing: border-box; border: 1px solid black; border-left-width: 4px; border-right-width: 4px; border-radius: 50%; } .half.note::after, .quarter.note::after { content: ""; height: 28px; width: 1px; background-color: black; position: absolute; top: -24px; right: 0; } .half.note::before, .quarter.note::before { position: absolute; content: ""; transform: rotatez(-15deg); border-radius: 50%; } .half.note::before { box-sizing: border-box; border: 1px solid black; border-top-width: 2.18181818px; border-bottom-width: 2.18181818px; } .quarter.note::before { background-color: black; } ..........完整代码请登录后点击上方下载按钮下载查看
网友评论0