Thursday, February 13, 2014

Colors and Backgrounds

Today I used what I learned about specifying colors in CSS in order to make a black and white webpage about Cabbages and Cauliflowers much more exciting. Here's what it started like, with CSS rules on only the text style:



Then I added color to the text, background color, and background images. This is the new style sheet:

<style type="text/css">

  body{margin-left: 10%;
    margin-right: 10%;
    background-color: #BBE09F;
    background-image: url(cabbage_C.gif);
    background-repeat: no-repeat;
    background-position: center 85px;
    background-attachment: fixed;
  }
   
  div#titlepage {
    padding: 1em;
    background-color: #D4F8B9;
    background-image: url(cabbage_C.gif);
    background-repeat: no-repeat;
    background-position: center 85px;
    background-attachment: fixed;
  }
  
  div#titlepage p {
    text-align: center;
    font-variant: small-caps;
    }
   
  p {
    text-align: justify;
    }
 
  h1,h2,h3,h4,h5,h6 {
    text-transform: uppercase;
    text-align: center;
    }
    h1 {
        color: #C30;
    }
    h2 {
        color: #630;
    }
    a:link {color:#030;}
    a:visited {color:#363;}
    a:hover {text-decoration:none;
    color:#030;
    background-color:#87B862;
    }
    a:active{color:#C30;}

    </style>

This is what it looks like now!


No comments:

Post a Comment