0

这是我应该创建的最终产品,我目前正处于该过程的这个阶段,我被困在如何做一个通过底部边框的 3/4 链接以及如何粗体标记两个边框最后一段。以及如何在两个边界之间创建空间,如最终产品所示

<!DOCTYPE html>
<html lang="sv">
  <head>
    <meta charset="utf-8" />
    <title>Uppgift 4E</title>
    <style>
    html {
        background-color: lightslategrey;
    }
    body {
        margin: auto;
        width: 500px;
        padding-bottom: 0.1px; /*knep för div margin */
        background-color: #f0ffff;
        text-align: center;
        font-family: sans-serif;

    }
    h1 {
        Color: purple;
    }
    #billy {
        color: darkred;
        border-style: solid;
        border-color: purple;
        border-width: 1.5px;
        border-radius: 5px;
        text-align: left;
    }
    #bob {
        color: darkgreen;
        border-style: solid;
        border-color: purple;
        border-width: 1.5px; /* border tjockhet */
        border-radius: 5px; /* rundiga kanter på border */
        text-align: left;
    }
    .two {
        font-size: large;
    }
    .three {
        font-size: small;
    }
    }
    #bob > .two > a {
        text-decoration: underline overline;
    }
    #bob > .three > a {
        text-decoration: line-through;
    }
    </style>
  </head>
  <body>
    <h1>Uppgift 4E</h1>
    <div id="billy">
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
      <p class="two">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
      <p class="three">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
    </div>
    <div id="bob">
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
      <p class="two">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
      <p class="three">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
    </div>
  </body>
</html>
4

1 回答 1

1

添加两件事可以帮助您为 p 标签左右边距和为 div 边距

<!DOCTYPE html>
<html lang="sv">
  <head>
    <meta charset="utf-8" />
    <title>Uppgift 4E</title>
    <style>
    html {
        background-color: lightslategrey;
    }
    body {
        margin: auto;
        width: 500px;
        padding-bottom: 0.1px; /*knep för div margin */
        background-color: #f0ffff;
        text-align: center;
        font-family: sans-serif;

    }
    h1 {
        Color: purple;
    }
    #billy {
        color: darkred;
        border-style: solid;
        border-color: purple;
        border-width: 1.5px;
        border-radius: 5px;
        text-align: left;
        margin: 10px;
    }
    #bob {
        color: darkgreen;
        border-style: solid;
        border-color: purple;
        border-width: 1.5px; /* border tjockhet */
        border-radius: 5px; /* rundiga kanter på border */
        text-align: left;
        margin: 10px;
    }
    p {
      margin-left: 5px;
      margin-right: 5px;
    }
    .two {
        font-size: large;
    }
    .three {
        font-size: small;
    }
    }
    #bob > .two > a {
        text-decoration: underline overline;
    }
    #bob > .three > a {
        text-decoration: line-through;
    }
    </style>
  </head>
  <body>
    <h1>Uppgift 4E</h1>
    <div id="billy">
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
      <p class="two">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
      <p class="three">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
    </div>
    <div id="bob">
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
      <p class="two">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
      <p class="three">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue <a href="">porttitor</a>.
      </p>
    </div>
  </body>
</html>

于 2019-05-08T19:13:23.530 回答