Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Level 1 - Week 3

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

Level 1 - Week 3

Avatar for Graham Lewis

Graham Lewis

June 23, 2015

More Decks by Graham Lewis

Other Decks in Technology

Transcript

  1. Types of image • JPG - 'regular' camera image •

    PNG - typically 'drawn' (in Photoshop etc) - can be transparent • GIF - typically 'drawn' - can be animated • SVG - vector graphic - not actually an image - but data
  2. Foreground images Inside HTML via the img tag... <img src=''

    alt=''> • src - the URL of the image • alt - for use if auto image download is turned off Note: the img tag is an inline element
  3. Sizing img { width: 400px; /* OR */ height: 400px;

    } DO NOT use both height AND width - unless you know they won’t change!
  4. Background images Inside CSS via the background rule... body {

    background-image: url(‘my-cat.jpg’); background-color: #fff; /* ALWAYS set a default background color! */ background-position: top left; /* top, right, bottom, left or center */ background-repeat: repeat; /* repeat-x, repeat-y, no-repeat or repeat */ }
  5. Text over images In your HTML... <div class=“cat”> <h1>Tom the

    Cat</h1> </div> In your CSS... .cat { background: #fff url(‘my-cat.jpg’) top left repeat; }