โจSVG Clock
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
browser โฉ SVG โฉ examples โฉ clock
๐พ replit: SVG Clock
<!-- The viewBox attribute gives the internal coordinate system -->
<!-- The width and height attributes are the screen size of the graphic -->
<svg id="clock" viewBox="0 0 100 100" width="250" height="250">
<!-- clock face -->
<circle
CSS
/* Styles for everything in the clock: */
#clock {
stroke: black; /* black lines */
stroke-linecap: round; /* with rounded ends */
fill: #ffe; /* on an off-white background */
}
#clock .face { stroke-width: 3; } /* Clock face outline */
#clock .ticks { stroke-width: 2; } /* Lines that mark each hour */
#clock .hands { stroke-width: 3; } /* How to draw the clock hands */
/* How to draw the numbers */
#clock .numbers {
/* โญ Note: CSS `font` shorthand property does NOT work for SVG tags */
font-family: sans-serif;
font-size: 10;
font-weight: bold;
text-anchor: middle;
stroke: none;
fill: black;
}