Customizing the height and width of an element with CSS
In previous chapters, we have learned how to add a logo to our Moodle course. In this chapter, we will learn how to customize the logo and how to change the number of pixels so that it fits the right height, by customizing our CSS.
Furthermore, we will use an online editor to understand how CSS works with an image and how the number of pixels varies. We can control the height and width of an element using CSS dimension properties. The height and width are automatically set to auto, that is to say, it is calculated by default by the browser.
In this case, we will change the default dimensions of the element. Therefore, these are the steps that we need to follow:
- Enter http://www.w3schools.com/css/default.asp.
- In the left-hand margin, click on
CSS Height/Width
, as shown in the following screenshot:
- Read the information provided about height and width. Click on Try it Yourself, as shown in the following screenshot:
- A new...