Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Animations in HTML 5

Featured Replies

Hi All,

I want to make some simple animated backgrounds for a clients websites. Probably something like rotating and drifting hexagons.

Any advice on an easy way to do this?

Regards

Rich

It's CSS3 you will need to utilise for animations - HTML5 is just the mark-up language. The tutorial below provides a pretty good introduction to animations with CSS3:

 

https://webdesign.tutsplus.com/tutorials/a-beginners-introduction-to-css-animation--cms-21068

 

You would need to look specifically at transforms and translate to make moving shapes, as seen below:

 

https://css-tricks.com/almanac/properties/t/transform/

 

These two resources should give you enough to get started. I should probably point out that with these animations comes a lot of considerations. For example, browser compatibility and responsiveness to name a few. They should be used sparingly and in my opinion it's usually better to avoid "gimmicky" designs.

It depends what you want to do. For basic animations you can just use CSS animate. or even just a transition - this is how I do most subtle animations.

 

If you want something more complex like timelines I would look to a JavaScript library like GSAP. Doing timelines in CSS is very error prone with a lot of magic numbers.

 

 

It should be mentioned that animations should add to the user experience and not be distracting. Things like parallax are often just thrown in to make things look cool and hip, but are often frustrating for visitors. Especially when most of them have terrible performance implications due to the way they have been written.
So ask yourself is there any real benefit in animated backgrounds? I would argue that they could be more of a detriment than an enhancement.

Edited by rbrtsmith

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.