当前位置: 首页 > news >正文

advanced-css: No.1

  • 本套教程学习来自视频:https://www.bilibili.com/video/BV1n94y1o7yS/?p=7&spm_id_from=pageDriver&vd_source=b79be8283df9418cb45941cc0bd583c6

案例

实现效果图

在这里插入图片描述

代码

HTML:

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900" rel="stylesheet"><link rel="stylesheet" href="css/icon-font.css"><link rel="stylesheet" href="css/style.css"><link rel="shortcut icon" type="image/png" href="img/favicon.png"><title>Natours | Exciting tours for adventurous people</title></head><body><header class="header"><div class="logo-box"><img src="img/logo-white.png" alt="Logo" class="logo"></div><div class="text-box"><h1 class="heading-primary"><span class="heading-primary-main">outdoors</span><span class="heading-primary-sub">is where life happiness</span></h1></div></header></body>
</html>

CSS:

* {margin: 0;padding: 0;box-sizing: border-box;
}body {font-family: "Lato", sans-serif;font-weight: 400;font-size: 16px;line-height: 1.7;color: #777;padding: 30px;
}.header {height: 95vh;background-image: linear-gradient(to right bottom, rgba(128, 214, 113, 0.804), rgba(39, 180, 133, 0.8)), url(../img/hero.jpg);background-size: cover;background-position: top;clip-path: polygon(0 0, 100% 0, 100% 80%, 0 100%);position: relative;
}.logo-box {position: absolute;top: 40px;left: 40px;
}.logo {width: 80px;
}.text-box {position: absolute;left: 50%;top: 40%;transform: translate(-50%, -50%);
}.heading-primary {color: #fff;text-transform: uppercase;
}.heading-primary-main {display: block;font-size: 60px;font-weight: 700;letter-spacing: 30px;
}.heading-primary-sub {display: block;font-size: 16px;font-weight: 700;letter-spacing: 15.7px;
}

相关知识

clip-path

使用裁剪方式创建元素的可显示区域

http://www.lryc.cn/news/227402.html

相关文章:

  • 最新宝塔面板第三方云端站点程序源码/第三方宝塔面板PHP源码/全开源ThinkPHP框架
  • 【Unity之UI编程】玩法面板的实现
  • 栈和队列:栈
  • 由浅入深学习统计学 - 常用统计图形学习
  • 【java进阶】集合的三种遍历(迭代器、增强for、Lambda)
  • Qt实现动态桌面小精灵(含源码)
  • Qt 自定义分页控件
  • Java中的7大设计原则
  • Spring Cloud和Kubernetes + Spring Boot 用哪个?
  • web-worker 基本使用
  • SpringBoot使用@PropertySource读取 properties 配置
  • 100天精通风控建模(原理+Python实现)——第5天:风控建模中数据标准化是什么?
  • find和grep命令的简单使用
  • 力扣:164. 最大间距(Python3)
  • 游戏平台采集数据
  • CSS让两个标签在同一行显示并自适应宽度
  • Leetcode154. Find Minimum in Rotated Sorted Array II
  • 【分析思路】测试数据分析思路
  • 链表的实现(文末附完整代码)
  • asp.net core 获取服务实例的几种方式
  • 指标体系:洞察变化的原因
  • Dell戴尔灵越Inspiron 7700 AIO一体机电脑原厂预装Windows10系统
  • 系统架构主题之九:软件设计模式及其应用
  • Spring IoC注解式开发
  • 智能一体化管网水位监测仪怎么样?
  • 个人网厅——销户
  • 通过创建自定义标签来扩展HTML
  • Nacos热更新
  • CSS3 中 transition 和 animation 的属性分别有哪些
  • 【狂神说Java】Nginx详解