Search code examples
javascriptcsstwitter-bootstrapsvgtooltip

Debugging! SVG logo & tooltip bug


I am pretty new at editing and embedding SVG to webpages. My client is a graphic designer so he created an svg logo for his website and wanted me embed it to his nav bar.

I am also using Bootstrap and as part of the development I am using bootstrap tooltips. However, once i embed the svg and edit the co-ordinates via viewbox, I encountered a problem with one of my tooltips.

The tooltip seems to be buggy with this particular logo. The rest of them are okay but for some reason I cannot figure out how to fix this one.

I have uploaded the website today for testing purposes and you can see the issue on http://edizorac.com/

The problematic logo is the second one on the navigation bar and you can also see my code through web inspector.

Any help/recommendation is appreciated!!

Thanks in advance :)

Update:

Sorry for any inconveniences. The svg code is as follows:

<li>
  <a href="#projects">
    <span>
        <svg version="1.2" baseProfile="tiny" x="0px" y="0px" width="70px" height="60px" viewBox="50 40 90 120" data-toggle="tooltip" title="Projects">
            <polygon fill="none" stroke="#ffffff" stroke-miterlimit="10" points="33.493,81.046 96.934,46.112 88.647,82.874 57.203,117.371 52.946,86.674 99.573,74.629 81.325,117.276 37.909,101.254"/>
            <polyline fill="none" stroke="#ffffff" stroke-miterlimit="10" points="96.451,81.928 114.361,106.172 112.365,112.871 82.791,113.852 "/>
            <line fill="none" stroke="#ffffff" stroke-miterlimit="10" x1="95.854" y1="47.473" x2="37.909" y2="101.254"/>
        </svg>
    </span>
   </a>
 </li>

Solution

  • May I suggest you have a read over this and also have a look at this to help you with SVG's

    Change the first line of your SVG block to:

    <svg version="1.2" baseProfile="tiny" x="0px" y="0px" width="40px" height="40px" viewBox="30 47 85 70" data-toggle="tooltip" title="" data-original-title="Projects">
    

    You made the following mistakes:

    • You had the height and width set incorrectly compared to the other SVG's (Height you had defined: 60px & Width you had defined 70px)
    • Your viewBox property was set incorrectly so the elements didn't align properly