简体   繁体   中英

Css animation - with vertical line on a horizontal line

I have an expanding line animation in css as can be seen in the demo link

I would like some help in figuring out how to add a vertical line at both ends when the animation stops.

Something like the attached image: 在此处输入图像描述

Can someone please help me with this?

Perhaps using pseudo elements

.line::before,
.line::after
{
  content: ''; /* important for pseudo elements */
  width: 4px;
  height: 20px;
  position: absolute;
  background: red;
}
.line::after { right: 0 } /* snap to right */
.line::before { left: 0 } /* snap to left */

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM