They appear visible in this image for better understanding. Next to this text, you'll also find an image with the schematics of the areas that will be specified in the following example. This will allow the user to follow the link by clicking only the desired areas of the image, and not in the entire image. Inside of it, we'll insert two areas ( area), one circular and the other rectangular, that will cover the elements we see in the image (a circle and a pice of text). In the example below, we'll create an image map and we'll associate it to the image. It's also required to specify the corrdinates for the shape (in the coords attribute) if a "default" shape hasn't been chosen. In HTML5, the alt attribute is mandatory when the alt attribute is present and must be ommited otherwise. It can't be declared as child of any other element. The area element can only have a map element as parent. In HTML5 only the area element provides this functionality. In previous versions of the standard, authors could also define image map areas with the a element. If they define an open polygon, the browser should close it by adding a segment between the first edge and the last one. The coords attribute must provide, one by one, the coordinates of the edges "x 1, y 1, x 2, y 2. poly: the area encolsed inside a polygon.If the radius is measured in percentage, its calculated as relative to the smaller size of the associated object. The coords attribute must provide the center and the radius "center-x, center-y, radius". The coords attribute must provide two oposite corners "left-x, top-y, right-x, bottom-y". The coords attribute must provide the coordinates of the shape in a way specific to each type of area. In other words, image maps make it possible to create a link out of one or more sections of the image ( img) they're associated with.įour types of shapes can be defined for each area of the image map, by declaring any of the values listed below in the shape attribute. Image maps allow authors to define sections in an image and, optionally, convert them into hyperlinks pointing to other resources. The area element defines a section or area in an image map.
0 Comments
Leave a Reply. |