CSS Times - HTML CSS CSS

HTML CSS examples for CSS:Time

Introduction

You can measure intervals using the CSS time, for example, 100ms.

The following table shows the supported time units.

Unit Identifier Description
s Specifies time in seconds
ms Specifies time in milliseconds (1s is equal to 1000ms)

The following code shows how to use ms to set time.

Demo Code

ResultView the demo in separate window

<!DOCTYPE HTML>
<html>
    <head>
        <title>Example</title>
        <style>
            p {<!--from w ww  .j a v a  2s  .co  m-->
                padding: 5px;
                border: medium double black;
                background-color: lightgray;
                font-family: sans-serif;
            }
            #mySpan {
                font-size: large;
                border: medium solid black;
            }
            #mySpan:hover {
                font-size: x-large;
                border: medium solid white;
                background-color: green;
                color: white;
                padding: 4px;
                -webkit-transition-delay: 100ms;
                -webkit-transition-property: background-color, color, padding,
                    font-size, border;
                -webkit-transition-duration: 500ms;
            }
        </style>
    </head>
    <body>
        <p>
            This is a test. This is a test. This is a test.
            <span id="mySpan">mySpan</span>.
        </p>
    </body>
</html>

Related Tutorials