SVG implements navigation animations

Source: Internet
Author: User

After animation

Html

<!DOCTYPE HTML><HTML>  <Head>    <MetaCharSet= "UTF-8">    <title>Animated SVG Hover Buttons</title>    <Linkrel= "stylesheet"href= "Css/style.css">  </Head>  <Body>    <DivID= "Workarea">              <Divclass= "position">                            <!--Start button, nothing above the is necessary -                <Divclass= "Svg-wrapper">                  <svgHeight= "Max"width= "Max"xmlns= "Http://www.w3.org/2000/svg">                    <rectID= "Shape"Height= "Max"width= "Max" />                    <DivID= "text">                      <ahref=""><spanclass= "Spot"></span>Button 1</a>                    </Div>                  </svg>                </Div>                <!--Next Button -                <Divclass= "Svg-wrapper" >                  <svgHeight= "Max"width= "Max"xmlns= "Http://www.w3.org/2000/svg" >                    <rectID= "Shape"Height= "Max"width= "Max" />                    <DivID= "text">                      <ahref=""><spanclass= "Spot"></span>Button 2</a>                    </Div>                  </svg>                </Div>                <!--Next Button -                <Divclass= "Svg-wrapper">                  <svgHeight= "Max"width= "Max"xmlns= "Http://www.w3.org/2000/svg">                    <rectID= "Shape"Height= "Max"width= "Max" />                    <DivID= "text">                      <ahref=""><spanclass= "Spot"></span>Button 3</a>                    </Div>                  </svg>                </Div>                <!--End Button -                          </Div>    </Div>  </Body></HTML>

Css

* {margin:0;padding:0;}Html,css{width:100%;Height:100%;}. Position{Margin-left:Auto;Margin-right:Auto;text-align:Center;Margin-top:15%;}#workarea{position:Absolute;width:100%;Height:100%;Background-color:#1e1a3e;font-family:Raleway;}#personal{Color: White;text-decoration:None;position:Absolute;Bottom:15px; Right:2%;}. Spot{position:Absolute;width:100%;Height:100%;Top:0; Left:0;}. Svg-wrapper{Margin-top:0;position:relative;width:150px;/*Make sure to use same height/width as in the HTML*/Height:40px;Display:Inline-block;Border-radius:3px;Margin-left:5px;Margin-right:5px}#shape{Stroke-width:4px;/*the width of the line*/Fill:Transparent;/*Fill Color*/Stroke:#009FFD;/*the color of the line*/Stroke-dasharray: About;/*Create dash width, spacing*/Stroke-dashoffset:-220;/*Where does the line begin ?*/transition:1s all ease;/*Animation*/}#text{Margin-top:-35px;text-align:Center;}#text a{Color: White;text-decoration:None;Font-weight: -;font-size:1.1em;}. Svg-wrapper:hover #shape{Stroke-dasharray:0;Stroke-width:3px;Stroke-dashoffset:0;Stroke:#06D6A0;}

SVG implements navigation animations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.