Image In Rectangle Html. If for whatever reason you sometimes feel like creating a rectangle using html css the below code is the easiest way to do so. Y 20 places the rectangle 20 px from the top margin the css fill opacity property defines the opacity of the fill color legal range.

The map will effectively overlay the entire image element but it s up to you to define the clickable area. In your script add an window onload. Unlike the hyperlink element in the svg example the coordinates in the image map don t have anything to do with the definition of the source image.
The x attribute defines the left position of the rectangle e g.
Use the css float property to let the image float to the left or to the right. If for whatever reason you sometimes feel like creating a rectangle using html css the below code is the easiest way to do so. A given rectangle can also be decorated using tags like background. Image maps have been around since html 3 meaning they have excellent browser support.