头像

ATRI




离线:9小时前


最近来访(4)
用户头像
ephemeral.
用户头像
Blueboy
用户头像
Kazimierz
用户头像
Anwma

活动打卡代码 工程课 Web-2.10. homework_10

ATRI
2天前
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

    <style>
      .container {
        display: flex;
        width: 50%;
        height: 500px;
        background-color: lightblue;
        margin: 10px;
      }

      .container > div {
        height: 120px;
        width: 120px;
      }

      .container > div:nth-child(odd) {
        background-color: lightsalmon;
      }

      .container > div:nth-child(even) {
        background-color: lightgreen;
      }

      .container:nth-child(1) {
        flex-wrap: wrap;
        justify-content: space-between;
        align-content: flex-start;
      }

      .container:nth-child(2) {
        flex-direction: row-reverse;
        flex-wrap: nowrap;
      }

      .container:nth-child(2) > div:nth-child(even) {
        flex-grow: 3;
        flex-shrink: 3;
      }

      .container:nth-child(2) > div:nth-child(odd) {
        flex-grow: 1;
        flex-shrink: 1;
      }
    </style>
  </head>

  <body>
    <div class="container">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
      <div>6</div>
    </div>

    <div class="container">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
      <div>6</div>
    </div>
  </body>
</html>



活动打卡代码 工程课 Web-2.9. homework_9

ATRI
2天前
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

    <style>
      .container {
        width: 500px;
        height: 500px;
        background-color: lightblue;
      }

      .item {
        width: 100px;
        height: 100px;
        margin: 10px;
        background-color: lightcoral;
        float: left;
      }

      .next-line {
        width: 150px;
        height: 150px;
        background-color: rgba(0, 0, 255, 0.5);
        clear: left;
      }
    </style>
  </head>

  <body>
    <div class="container">
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
      <div class="next-line"></div>
    </div>
  </body>
</html>



活动打卡代码 工程课 Web-2.8. homework_8

ATRI
2天前
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

    <style>
      body {
        height: 2000px;
        margin: 0;
      }

      div {
        width: 200px;
        height: 200px;
        background-color: lightblue;
        margin: 20px;
      }

      div:nth-child(1) {
        position: static;
      }

      div:nth-child(2) {
        position: relative;
        left: 50px;
        top: 15px;
      }

      div:nth-child(3) {
        position: absolute;
        background-color: rgba(0, 0, 255, 0.5);
        left: 30px;
        top: 30px;
      }

      div:nth-child(4) {
        position: fixed;
        background-color: rgba(0, 255, 0, 0.5);
        left: 100px;
        top: 250px;
      }

      div:nth-child(10) {
        position: sticky;
        background-color: rgba(255, 0, 0, 0.5);
        bottom: 10px;
      }
    </style>
  </head>

  <body>
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
    <div>5</div>
    <div>6</div>
    <div>7</div>
    <div>8</div>
    <div>9</div>
    <div>10</div>
  </body>
</html>



活动打卡代码 工程课 Web-2.7. homework_7

ATRI
2天前
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

    <style>
      div {
        width: 300px;
        height: 300px;
        margin: 10px;
        padding: 10px;
        background-color: lightblue;
        border: solid 10px gray;
      }

      div:nth-child(1) {
        box-sizing: content-box;
      }

      div:nth-child(2) {
        box-sizing: border-box;
      }
    </style>
  </head>

  <body>
    <div>1</div>
    <div>2</div>
  </body>
</html>



活动打卡代码 工程课 Web-2.6. homework_6

ATRI
2天前
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

    <style>
      div {
        width: 100px;
        height: 100px;
        background-color: lightsalmon;
      }

      div:nth-child(1) {
        margin: 10px 20px 30px 40px;
        padding: 10px 20px 30px 40px;
      }

      div:nth-child(2) {
        margin: 0 auto;
        /* 垂直居中:
        /* position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%); */
      }
    </style>
  </head>

  <body>
    <div>文本1</div>
    <div>文本2</div>
  </body>
</html>



活动打卡代码 工程课 Web-2.5. homework_5

ATRI
2天前
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

    <style>
      .container {
        display: block;
        width: 500px;
        height: 500px;
        margin: 20px;
        padding: 10px;
        background-color: lightblue;
      }

      .inline-block-div {
        display: inline-block;
        width: 100px;
        height: 100px;
        margin: 10px;
        padding: 10px;
        background-color: blue;
        color: white;
      }

      span {
        display: inline;
        background-color: bisque;
        color: green;
        margin: 0px 20px 0px 20px;
        padding: 0px 10px 0px 10px;
      }

      .block-div {
        display: block;
        height: 100px;
        width: 100px;
        padding: 10px;
        margin: 10px;
        color: white;
        background-color: blue;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    </style>
  </head>

  <body>
    <div class="container">
      <div class="inline-block-div">div-1</div>
      <div class="inline-block-div">div-2</div>
      <div class="inline-block-div">div-3</div>
      <br />
      <span>span-1</span>
      <span>span-2</span>
      <span>span-3</span>
      <br />
      <div class="block-div">123456789101112</div>
    </div>
  </body>
</html>




ATRI
5天前

效果:http://127.0.0.1:5500/bilibili.html

HTML

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="/static/css/bilibili.css" />
  </head>
  <body>
    <div class="user-card">
      <div class="user-card-head"></div>
      <div class="user-card-body">
        <div class="user-card-body-left">
          <img
            src="https://cdn.acwing.com/media/user/profile/photo/171103_lg_6fce1eaf39.png"
            alt=""
          />
        </div>
        <div class="user-card-body-right">
          <div class="user-card-body-right-text">
            <div class="user-card-body-right-text-username">
              鹿乃knao
              <span class="user-card-body-right-text-username-item">lv5</span>
            </div>
            <div class="user-card-right-text-reputation">
              <span class="user-card-right-text-reputation-item">
                <span>520</span>
                <span>关注</span>
              </span>
              <span class="user-card-right-text-reputation-item">
                <span>520</span>
                <span>粉丝</span>
              </span>
              <span class="user-card-right-text-reputation-item">
                <span>520</span>
                <span>获赞</span>
              </span>
            </div>
          </div>
          <div class="user-card-body-right-button">
            <button>+关注</button>
            <button>发消息</button>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>

CSS实现

.user-card {
  width: 366px;
  height: 215px;
  box-shadow: 2px 2px 5px lightblue;
  border-radius: 5px;
}

.user-card-head {
  background-image: url("/static/images/优.png");
  background-size: cover;
  width: 100%;
  height: 85px;
}

.user-card-body {
  width: 100%;
  height: calc(100% - 85px);
  box-sizing: border-box;
  padding-top: 12px;
}

.user-card-body-left {
  width: 70px;
  height: 100%;

  float: left;
  text-align: center;
}

.user-card-body-right {
  width: calc(100% - 70px);
  height: 100%;
  float: left;
}

.user-card-body-left > img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

.user-card-body-right-text {
  width: 100%;
  height: 78px;
}

.user-card-body-right-text-username {
  font-size: 16px;
  font-weight: bolder;
  color: #fb7299;
}

.user-card-body-right-text-username-item {
  font-size: 12px;
  font-style: italic;
  color: #e46829;
  padding-left: 6px;
}

.user-card-right-text-reputation {
  margin-top: 12px;
}

.user-card-right-text-reputation-item > span:nth-child(1) {
  font-size: 12px;
  color: #222222;
}

.user-card-right-text-reputation-item > span:nth-child(2) {
  font-size: 12px;
  color: #9499a0;
  padding-right: 20px;
}

.user-card-right-body-button {
  width: 100%;
  height: calc(100% - 78px);
}

.user-card-body-right-button > button:nth-child(1) {
  box-sizing: border-box;
  padding-right: 1px;
  margin-right: 6px;
  width: 90px;
  height: 25px;
  border-radius: 5px;
  border-style: none;
  background-color: #00b5e5;
  color: white;
  cursor: pointer;
}

.user-card-body-right-button > button:nth-child(2) {
  box-sizing: border-box;
  padding-right: 1px;
  margin-right: 6px;
  width: 90px;
  height: 25px;
  border-radius: 5px;
  background-color: white;
  border: #ccd0d7 solid 1px;
  color: #60757a;
  cursor: pointer;
}

.user-card-body-right-button > button:nth-child(2):hover {
  border-color: #00b5e5;
  color: #00b5e5;
  transition: 700ms;
}

.user-card-body-right-button > button:nth-child(1):hover {
  background-color: lightpink;
  color: white;
  transition: 700ms;
}




ATRI
6天前

展示效果:http://127.0.0.1:5500/index.html

HTML

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="/static/css/style.css" />
  </head>
  <body>
    <div class="user-card">
      <div class="user-card-head">asked Feb 9, 2019 at 18:18</div>
      <div class="user-card-body">
        <div class="user-card-photo">
          <a
            href="https://space.bilibili.com/488654468?spm_id_from=333.1007.0.0"
            target="_blank"
            ><img
              src="https://cdn.acwing.com/media/user/profile/photo/171103_lg_6fce1eaf39.png"
              alt=""
          /></a>
        </div>
        <div class="user-card-info">
          <div class="user-card-info-username">
            <a
              href="https://www.acwing.com/user/myspace/index/171103/"
              target="_blank"
              >kano</a
            >
          </div>
          <div class="user-card-info-reputation">
            <span style="color: #6a737c; font-weight: bolder"> 1,075</span>
            <div
              class="user-card-info-reputation-sign"
              style="background-color: #f9cc00"
            ></div>
            <span>3</span>
            <div
              class="user-card-info-reputation-sign"
              style="background-color: #b4b8bc"
            ></div>
            <span>14</span>
            <div
              class="user-card-info-reputation-sign"
              style="background-color: #cda683"
            ></div>
            <span>25</span>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>

CSS

.user-card {
  width: 200px;
  height: 67.69px;
  background-color: #dbeaf7;
  margin: 100px auto;
  padding: 5px 6px 7px 7px;
  box-sizing: border-box;
}

.user-card-head {
  font-size: 12px;
  color: #6a737c;
  margin: 1px 0px 4px 0px;
}

.user-card-photo img {
  width: 32px;
  height: 32px;
}

.user-card-photo {
  float: left;
}

.user-card-info {
  float: left;
  margin: 0px 0px 0px 8px;
}

.user-card-info-username {
  font-size: 12px;
  color: #0074cc;
}

.user-card-info-reputation {
  font-size: 12px;
  color: #8c8395;
}

.user-card-info-username a {
  text-decoration: none;
  color: #0074cc;
}

.user-card-info-reputation-sign {
  width: 6px;
  height: 6px;
  background-color: lightblue;
  border-radius: 50%;
  display: inline-block;
  margin: 0px 1.5px 0px 2px;
  position: relative;
  top: -1.5px;
}



活动打卡代码 工程课 Web-2.4. homework_4

ATRI
7天前
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div {
        height: 300px;
        width: 300px;
      }

      div:nth-child(1) {
        border-width: 10px;
        border-style: solid dotted inset dashed;
        border-color: blue red;
        border-radius: 50%;
      }

      div:nth-child(2) {
        border: solid 3px black;
        border-radius: 10px;
      }
    </style>
  </head>

  <body>
    <div></div>
    <div></div>
  </body>
</html>



活动打卡代码 工程课 Web-2.3. homework_3

ATRI
7天前
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div {
        width: 300px;
        height: 300px;
        margin: 10px;
      }

      div:nth-child(1) {
        background-color: lightblue;
      }

      div:nth-child(2) {
        background-image: url("/static/images/mountain.jpg");
        background-size: 100% 100%;
        background-repeat: no-repeat;
      }

      div:nth-child(3) {
        background-image: url("/static/images/mountain.jpg"),
          url("/static/images/logo.png");
        background-size: 50% 100%, 50% 100%;
        background-repeat: no-repeat;
        background-position: top left, 150px 0;
      }

      div:nth-child(4) {
        background-image: url("/static/images/mountain.jpg");
        background-size: 100% 100%;
        background-repeat: no-repeat;
        background-attachment: fixed;
      }
    </style>
  </head>

  <body>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </body>
</html>