" ."/> " .">
Home > Article > Web Front-end > Can elements stretch width in html5?
The elements in html can stretch the width. You only need to use the style and transform attributes together with the scaleX() function to set the stretching multiple of the element width. The syntax is "
".
The operating environment of this tutorial: Windows 10 system, HTML5 version, Dell G3 computer.
Can elements in HTML5 stretch their width?
In HTML, if you want to stretch the width of an element, you need to use the style and transform attributes. Cooperate with the scaleX() function.
The style attribute is used to set the style of the element.
The transform attribute is used to allow the element to be stretched.
The scaleX() function is used to set the factor of element stretching.
The example is as follows:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <img src="1118.02.png" style="max-width:90%" alt="Can elements stretch width in html5?" > </body> </html>
Output result:
Recommended tutorial: "html video tutorial"
The above is the detailed content of Can elements stretch width in html5?. For more information, please follow other related articles on the PHP Chinese website!