Adding Dimensions

To make a sidebar you can add a width:

width: 500px;

If you have an image, for example, you can use a percentage. 100%, would be 100 percent of the parent container (i.e. computer screen, tablet screen, or phone screen). Great when you are building websites that adapt to the screen width.

.author-img {
    width: 100%;
    height: auto;
}

Use “auto” in CSS if you have a width or height that you want to keep the aspect ratio, and you have width and height numbers in your HTML file. CSS will overwrite your HTML numbers.

This entry was posted in Web Developer Course and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *