Basic test for the transform property
described in the CSS3 Transforms spec
using the translate()
function
<html>
<head>
<title>CSS Transforms Test: transform property with translate function</title>
<link rel="author" title="Your Name" href="mailto:youremail@address.com">
<link rel="help" href="http://www.w3.org/TR/css3-transforms/#transform-property">
<link rel="help" href="http://www.w3.org/TR/css3-transforms/#two-d-transform-functions">
<link rel="match" href="reference/css-transform-translate-ref.html">
<meta name="assert"
content="This transform moves the element by 100 pixels in both the X and Y directions.">
. . .
Add an element with the transform applied
<style type="text/css">
.greenSquare {
position: absolute;
background: green;
top: 0;
left: 0;
width: 100px;
height: 100px;
transform: translate(100px, 100px);
}
. . .
</style>
Add an element that renders identically
<style type="text/css">
.greenSquare {
position: absolute;
background: green;
top: 100px;
left: 100px;
width: 100px;
height: 100px;
}
. . .
</style>
Add element only visible when the test fails
<style type="text/css">
. . .
.redSquare {
position: absolute;
background: red;
top: 100px;
left: 100px;
width: 100px;
height: 100px;
}
</style>
Simple statement of how the page renders when the test passes
<body>
<p>The test passes if there is a green square and no red.</p>
. . .
</body>
Add the red & green elements
<body>
<p>The test passes if there is a green square and no red.</p>
<div class="redSquare"></div>
<div class="greenSquare"></div>
</body>
Add the green element
<body>
<p>The test passes if there is a green square and no red.</p>
<div class="greenSquare"></div>
</body>