Size your image using CSS


Size Your Image:

  •  CSS has a property called  "width" that controls an element's width. Just like with fonts, we'll use "px"  (pixels) to specify the image's width.
  • For example, if we wanted to create a CSS class called "larger-image" that gave HTML elements a width of 500 pixels, we'd use:

<style>
  .larger-image {
    width: 500px;
  }
</style

Add  Borders  Around  Your  Elements:

  • CSS borders have properties like style, color, and width.
  • For example, if we wanted to create a red, 5-pixel border around an HTML element, we could use this class:

<style>
  .thin-red-border {
    border-color: red;
    border-width: 5px;
    border-style: solid;
  }
</style>
  • We can round out the corners of the borders using the CSS "border-radius" property.
  • In addition to pixels, you can also specify the "border-radius" using a percentage.

No comments:

Post a Comment