DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
11 Monitoring and Observability Tools for 2023
Learn more
  1. DZone
  2. Coding
  3. Languages
  4. Drive the animated CSS car down the SVG road

Drive the animated CSS car down the SVG road

John Esposito user avatar by
John Esposito
·
Oct. 27, 11 · Interview
Like (0)
Save
Tweet
Share
11.58K Views

Join the DZone community and get the full member experience.

Join For Free

CSS beat straight HTML because CSS lets browsers actually do something. Instead of producing a static grid, like crudely bitmapped page, CSS sends a some chunks of instruction to the browser: take this, then do something to it. Replacing description with instruction is at the heart of modern computing, but (as web developers especially know) not all technologies have caught up.

Bitmapped images, for example, are notoriously old-fashioned. They just identify which dots to light, and how. Vector graphics are, in a sense, the opposite -- the object itself is represented by a mathematical formula -- but the formula is still a (much-simplified) description. SVG files are written, after all, in a markup language (however eXtensible).

Now CSS animations meld the markup and more complex instruction by letting the browser do a lot more dynamic work. And we've definitely seen some awesome CSS3 animation lately.

But today, another step along the path of instruction: a sweet new CSS animation along a path at constant speed.

Here's what you get:

SVG path on the left, CSS on the right, results on the bottom. Unlike my antiquarian bitmap, the real thing shows the little car running around the (SVG) star.

And the code is all quite simple (if a little tedious for sorta-right-brainers like me).

Experiment with the paths and peruse the code here.

CSS SVG

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • What Is API-First?
  • Understanding and Solving the AWS Lambda Cold Start Problem
  • Important Data Structures and Algorithms for Data Engineers
  • Java Code Review Solution

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: