Attributes: Width, Height, Length, and Text

Learn the basics of the width, height, length, and text attributes.

width, height

width and height are required attributes of the rectangle element. width designates the width of the rectangle and height designates the height. (If you’re wondering, I often struggle defining the obvious.)

The following is an example of the code section required to draw a rectangle (using only the required attributes):

Get hands-on with 1200+ tech skills courses.