CSS相关笔记

文字相关
在这里插入图片描述

.text {
  width: 200px;
  line-height: 1.5em;
  background: beige;
  background-size: auto 3em;
  background-origin: content-box;
  background-image: linear-gradient(rgba(0, 0, 0, 0.2) 50%,
      transparent 0);

  font-variant-ligatures: common-ligatures discretionary-ligatures historical-ligatures;
}

<pre class="text">
  &#xfb01
  de&#xfb01;ne
  
  while (true) {
    var d = new Date();
    if (d.getDate() == 1 && d.getMonth == 3) {
      alert("TROLOLOL");
    }
  }
</pre>

在这里插入图片描述在这里插入图片描述

 <style>
      .line {
        color: #333;
        text-decoration-color: red;
        text-decoration-style: double;
        text-decoration-skip-ink: auto;
        text-underline-position: auto;
        text-decoration-line: line-through;
      }
    </style>
    <a href="javascript:void(0);" class="line">测试下划线absfgghjji</a>

在这里插入图片描述

<style>
    .text2 {
      width: 200px;
      background: hsl(210, 13%, 40%);
      color: hsl(210, 13%, 75%);
      text-shadow: 0 -1px 1px black;
    }
  </style>
  <div class="text2">
    Lorem ipsum dolor sit amet consectetur adipisicing elit. Ullam earum neque nihil accusantium impedit ea fugit
    aperiam veniam corporis aut, illo obcaecati suscipit atque vero, facilis rerum perferendis ab porro?
  </div>

在这里插入图片描述

<style>
    h1 {
      font: 500%/1 Rockwell, serif;
      background: deeppink;
      color: white;
      display: block;
      width: 200px;
      height: 200px;
      /* display: flex;
      align-items: center;
      justify-content: center; */
    }
    h1 #css {
      fill: currentColor;

    }
    h1 svg {
      overflow: visible
    }
    h1 use {
      stroke: black;
      stroke-width: 6;
      stroke-linejoin: round;
    }
  </style>
  <h1>
    <svg width="2em" height="1.2em">
      <use xlink:href="#css" />
      <text x="0" y="1.2em" id="css">CSS</text>
    </svg>
  </h1>

在这里插入图片描述
在这里插入图片描述

<style>
    a {
      background: #203;
      color: white;
      transition: 1s;
      padding: 20px;
      font-size: 36px;
      font-weight: bolder;
      text-decoration: none;
    }

    a:hover {
      color: transparent;
      text-shadow: 0 0 .1em white, 0 0 .3em white;
    }
  </style>
  <a href="">DIzzy</a>

在这里插入图片描述

<style>
    .text4 {
      font-size: 36px;
      font-weight: bolder;
      padding: 20px;
      background: #58a;
      color: white;
      text-shadow: 0 1px hsl(0, 0%, 85%),
        0 2px hsl(0, 0%, 80%),
        0 3px hsl(0, 0%, 75%),
        0 4px hsl(0, 0%, 70%),
        0 5px hsl(0, 0%, 65%),
        0 5px 10px black;
    }
  </style>
  <span class="text4">CSS3D</span>

在这里插入图片描述

<style>
    .circular {
      width: 100px;
      height: 100px;
      margin: 50px;
      display: inline-block;
    }

    .circular path {
      fill: none;
    }

    .circular svg {
      display: block;
      overflow: visible;
    }
  </style>
  <!-- <div class="circular">
    <svg viewBox="0 0 100 100">
      <path d="M 0,50 a 50,50 0 1,1 0,1 z" id="circle" />
      <text>
        <textPath xlink:href="#circle">
          circular reasoning works because
        </textPath>
      </text>
    </svg>
  </div> -->
  <span class="circular">
    circular reasoning works because
  </span>
  <span class="circular">
    circular 中文效果
  </span>

在这里插入图片描述

<style>
    .text5 {
      display: inline-block;
      width: 200px;
      height: 100px;
      padding: 15px;
      border: 1px solid silver;
      overflow: auto;
      background:
        linear-gradient(white, hsla(0, 0%, 100%, 0)),
        radial-gradient(at top, rgba(0, 0, 0, .2), transparent 70%),
        linear-gradient(to top, white, hsla(0, 0%, 100%, 0)) bottom,
        radial-gradient(at bottom, rgba(0, 0, 0, .2), transparent 70%) bottom;
      background-repeat: no-repeat;
      background-size: 100% 30px, 100% 15px, 100% 30px, 100% 15px;
      background-attachment: local, scroll
    }
  </style>
  <div class="text5">
    Lorem ipsum dolor sit amet consectetur, adipisicing elit. Sit neque ab iure tempore sint dolorum aut quia! Atque,
    reiciendis. Illo voluptates autem pariatur maxime. Tenetur commodi quia magni tempora odit?
  </div>

在这里插入图片描述

<style>
    .image-slider {
      position: relative;
      display: inline-block;
      width: 500px;
      height: 280px;
    }

    .image-slider>div {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      width: 50%;
      overflow: hidden;
    }

    .image-slider img {
      display: block;
      width: 500px;
      user-select: none;
    }

    .image-slider input {
      position: absolute;
      left: 0;
      bottom: 10px;
      width: 100%;
      margin: 0;
    }
  </style>
  <div class="image-slider">
    <img src="./images/14.png" alt="Before" />
    <img src="./images/14-2.png" alt="After" />
  </div>

在这里插入图片描述

<style>
    figure {
      padding: 10px;
      border: 1px solid silver;
      max-width: 300px;
      max-width: min-content;
    }
  </style>
  <h2>自适应内部环境</h2>
  <div>
    <p>Lorem ...</p>
    <figure>
      <img style="max-width:inherit" src="https://picsum.photos/400/300" />
      <figcaption>
        The great Sir Adam Catlace was named after
        Countess Ada Lovelace, the first programmer.
      </figcaption>
    </figure>
    <p>Lorem ...</p>
  </div>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值