我正在尝试制作一个跨页面的标题。

我在互联网上四处张望,并尝试了他们所说的方法,但没有成功。至少对于我来说。

这就是我得到的:

html - CSS-使背景跨页面?-LMLPHP

这是我的代码:



/* USEFUL STUFF
green colour #1(like the .BigTitle): #00CC00
cream colour: #FFFFCC
*/
body{
  background-color:#FFFFCC;
}
.BigTitle{
  background-color: #00CC00;
  width: 100%;
  text-align: center;
}

<div class="BigTitle"><h1>Loriem Ipsum</h1></div>
<div class="sidebar">
  <ul>
    <b>
      <li>STUFF</li>
      <li>STUFF</li>
      <li>STUFF</li>
      <li>STUFF</li>
    </b>
  </ul>
</div>
<div class="what">
  <h1>Lorium Ipsum</h1>
  <p>Bacon ipsum dolor amet fugiat t-bone kevin prosciutto. Duis biltong filet mignon shankle bacon ground round, commodo salami do. Ex qui pastrami cow, aute anim alcatra. Jerky sausage ullamco tail, aliquip et nostrud excepteur beef ad cupidatat sint filet mignon chicken.</p>
  <p>Turducken meatloaf ham hock nulla meatball. Ullamco qui officia quis filet mignon fugiat. Flank irure pig, sausage consectetur shoulder ea incididunt. Aliqua eu kielbasa andouille aute mollit prosciutto enim shankle rump irure. Bresaola consectetur aute, laboris beef short loin dolore. Incididunt sed labore ad fatback, voluptate dolore mollit ea pancetta tongue.</p>
  <p>Lorem esse kevin dolor jowl eiusmod shoulder deserunt kielbasa swine nisi et pancetta sunt ribeye. Est aliqua flank dolore dolor pork chop turducken in ex. Fugiat shank pork belly jowl id, irure turducken pork loin pork velit laborum tri-tip. Tenderloin ribeye proident nulla hamburger irure mollit short ribs ball tip pastrami. Pork chicken ex pastrami.</p>
  <p>Nulla tempor pork chicken in ullamco eiusmod consectetur ut. Venison beef ribs drumstick, shank in tenderloin dolor. Boudin aute proident sed, cow deserunt tongue sirloin porchetta aliquip dolor dolore aliqua chicken. Alcatra ham laboris pig aute landjaeger in occaecat anim consectetur tempor. Brisket nostrud commodo magna reprehenderit, ribeye nisi pancetta esse qui. Ex hamburger quis, leberkas meatloaf turkey shoulder sint filet mignon picanha nulla sirloin.</p>
  <p>Veniam adipisicing meatloaf, esse lorem doner andouille sirloin est chuck ad pariatur. Aliqua enim ham labore brisket leberkas. Drumstick id tri-tip, fugiat sint bresaola aliqua hamburger ullamco pig anim chicken cow aliquip boudin. Cillum venison non, picanha incididunt esse ex bresaola andouille irure anim jerky. Dolor corned beef leberkas, velit voluptate pork loin sunt pork pariatur.</p>
</div>

最佳答案

明确设置在CSS正文中{margin:0px}

关于html - CSS-使背景跨页面?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33357666/

10-11 23:52