How to make width property start right to left instead of left to right


Lopez

I want ::beforethe animation to start right to left width: 100%;and when you hover it the animation go left to right (back) width: 0;is there a way to do this with css?

span {
  display: inline-block;
  text-align: center;
  line-height: 40px;
  transition: ease-in-out 3s;
}

span::before , span::after{
  content: " ";
  display: block;
  width: 100%;
  height: 5px;
  background-color: red;
  transition: ease-in-out 3s;

 
}
span::before {
    left: auto;
    bottom: auto;
    right: 0;
    top: 2px;
    transition: ease-in-out 3s;
}
span:hover::after, span:hover::before{
  width: 0;
  transition: ease-in-out 3s;
}

.kotak:hover {
  width: 0%;
}
<!DOCTYPE html>
<html>
    <head>
        <title>Simple Website</title>
        <link rel="stylesheet" href="style.css">
      </head>
      
      <body>
        
        <Span>PLACEHOLDER</Span>
     </body>
</html>

Accompany Affi

Simplify your logic as follows. Toggle between and leftto rightcontrol the location

span {
  display: inline-block;
  line-height: 40px;
  background:
   linear-gradient(red 0 0) top    right,
   linear-gradient(red 0 0) bottom left;
  background-repeat:no-repeat;
  background-size:100% 5px;
  transition: ease-in-out 1s,background-position 0s 1s;
  /* or simply transition: ease-in-out 1s */
}

span:hover{
  background-size:0% 5px;
  background-position: /* remove this to keep the same position */
   top    left,
   bottom right
}
<span>PLACEHOLDER</span>

Related


How to make this slide left to right instead of

Jessica baby: Could someone show how this slide can go left to right instead of top to bottom? var current = 0, slides = document.querySelectorAll(".randtext"); setInterval(function() { for (var i = 0; i < slides.length; i++) { slides[i].style.opacity

How to make this slide left to right instead of

Jessica baby: Could someone show how this slide can go left to right instead of top to bottom? var current = 0, slides = document.querySelectorAll(".randtext"); setInterval(function() { for (var i = 0; i < slides.length; i++) { slides[i].style.opacity

How to make this slide left to right instead of

Jessica baby: Could someone show how this slide can go left to right instead of top to bottom? var current = 0, slides = document.querySelectorAll(".randtext"); setInterval(function() { for (var i = 0; i < slides.length; i++) { slides[i].style.opacity

How to make this slide left to right instead of

Jessica baby: Could someone show how this slide can go left to right instead of top to bottom? var current = 0, slides = document.querySelectorAll(".randtext"); setInterval(function() { for (var i = 0; i < slides.length; i++) { slides[i].style.opacity

Pad width right to left instead of default left to right

Sohail I'm trying to get this rating star system to work from right to left, and it works fine, but as soon as it hits a level of 3.5, i.e. it needs to be half full of stars, it uses the left side of it. I would like to know how to make the star fill the empty

Pad width right to left instead of default left to right

Sohail I'm trying to get this rating star system to work from right to left and it's working fine, but as soon as it hits something like 3.5, i.e. a star needs to be filled halfway, it's filled with half the width of the image used from it The star is to its l

Pad width right to left instead of default left to right

Sohail I'm trying to get this rating star system to work right to left and it's working fine, but as soon as it gets to something like 3.5, i.e. a star needs to be filled halfway, it's filled with half the width of the image used from it The star is to its lef

Right-to-left instead of left-to-right start button

engineer I'm trying to get this to start Buttonat the right edge LinearLayoutand set Button 5dpthe right edge from the right LinearLayout, with the TextViewleft button showing. Currently, it only allows buttons to be set from the "left" edge of a linear layout

Right-to-left instead of left-to-right start button

engineer I'm trying to get this to start Buttonat the right edge LinearLayoutand set Button 5dpthe right edge from the right LinearLayout, with the TextViewleft button showing. Currently, it only allows buttons to be set from the "left" edge of a linear layout

Right-to-left instead of left-to-right start button

engineer I'm trying to get this to start Buttonat the right edge LinearLayoutand set Button 5dpthe right edge from the right LinearLayout, with the TextViewleft button showing. Currently, it only allows buttons to be set from the "left" edge of a linear layout

Right-to-left instead of left-to-right start button

engineer I'm trying to get this to start Buttonat the right edge LinearLayoutand set Button 5dpthe right edge from the right LinearLayout, with the TextViewleft button showing. Currently, it only allows buttons to be set from the "left" edge of a linear layout

Right-to-left instead of left-to-right start button

engineer I'm trying to get this to start Buttonat the right edge LinearLayoutand set Button 5dpthe right edge from the right LinearLayout, with the TextViewleft button showing. Currently, it only allows buttons to be set from the "left" edge of a linear layout

How to make div container width increase from left to right

Sarah I have a container that holds some buttons in the top right corner of the page. I have set its position to fixed and given it the specific width and height I want. The problem is when the text on the button increases, it leaves the page. I can set overfl

Start snapping from the right instead of the left

Valukas I have the following RE that needs to match from the end of the string. String: AAA. A ZZZ-X37 AAA 4X X9 A ZZZ-X37 AAA 4X A ZZZ-X37 about: ^(?<g1>\s?[a-zA-Z\.]*)(?<g2>\s?[a-zA-Z\d]*)?(?<g3>\s?[a-zA-Z\d]*)?(?<g4>\s?[a-zA-Z]*)(?:\s?(?P<CAPT1>[A-Z]*)(?

Disable CSS property on hover -> right instead of left

diabetes I have an absolutely positioned div. It's located 10px from the left . I want to move it to a new position of 10px from the right on hover . is it possible? I would like to "cancel" the "left" property on hover and instead add a new "right" property:

Disable CSS property on hover -> right instead of left

diabetes I have an absolutely positioned div. It's located 10px from the left . I want to move it to a new position of 10px from the right on hover . is it possible? I would like to "cancel" the "left" property on hover and instead add a new "right" property:

Disable CSS property on hover -> right instead of left

diabetes I have an absolutely positioned div. It's located 10px from the left . I want to move it to a new position of 10px from the right on hover . is it possible? I would like to "cancel" the "left" property on hover and instead add a new "right" property:

Disable CSS property on hover -> right instead of left

diabetes I have an absolutely positioned div. It's located 10px from the left . I want to move it to a new position of 10px from the right on hover . is it possible? I would like to "cancel" the "left" property on hover and instead add a new "right" property:

Disable CSS property on hover -> right instead of left

diabetes I have an absolutely positioned div. It's located 10px from the left . I want to move it to a new position of 10px from the right on hover . is it possible? I would like to "cancel" the "left" property on hover and instead add a new "right" property: