CSS Image Examples

In the CSS Style Sheet

.round  {
  border-radius: 50%;
}

Take some time and fiddle with these settings to understand HOW they work.

.thumbnail{
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
  width: 150px;
}

Now you will see a change when you put your mouse hovers overan image file

img:hover {
  opacity: 0.2;
}

Now add two different images to your HTML folder. Use the same <img> tag as before, but don't but in a height or a width - just the src and the alt

Now adjust the settings for width and opacity, try and add a border or center it

If you are feeling crazy - use this to add a separate section at the top of your website

.header {
  background-color: #F1F1F1;
  text-align: center;
  padding: 20px;
}

Last updated