css布局倾斜背景行效果代码
代码语言:html
所属分类:布局界面
代码描述:css布局倾斜背景行效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;800&display=swap" rel="stylesheet"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body { font-family: "Montserrat", sans-serif; font-size: clamp(1rem, 2.28vw, 1.5rem); line-height: 1.54; font-weight: 500; margin: 100px 0; } h2 { font-size: clamp(3.5rem, 8vw, 5.25rem); font-weight: 800; margin-bottom: 16px; } p { margin: 1em 0; } img { width: 100%; } .row { display: flex; flex: 1; justify-content: center; padding: 100px 0; } .row + .row { margin-top: 50px; } .rowBackground { background-color: #e6e6e6; } .skew { transform: skewY(-11.5deg); } .column { padding: 0 15px; max-width: 1000px; } .skew .column { transform: skewY(11.5deg); } .media { display: grid; grid-column-gap: 26px; grid-template-columns: 1fr; } .mediaImg { align-self: center; } @media (min-width: 48rem) { .media { grid-template-columns: 1.5fr 3fr; } } </style> </head> <body > <div class="row rowBackground skew"> <div class="column"> <h2>Title</h2> <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Rerum consectetur facilis laboriosam cum soluta. Facilis eos, eveniet repellendus eius saepe perferendis! Dolores minus ratione accusantium? Et modi mollitia, temporibus hic voluptate nulla architecto atque asperiores, exercitationem repellendus at? In esse debitis aspernatur fuga error quae dolorum harum sit! Voluptatibus, quos.</p> </div> </div>.........完整代码请登录后点击上方下载按钮下载查看
网友评论0