Jump to content

musicman

Members
  • Posts

    62
  • Joined

  • Last visited

Posts posted by musicman

  1. Hi,
    this is from the page source:

    <section id="block-block-33" class="block block-block col-md-2 clearfix"> <p> <img alt="dog" src="http://godrupal.info/shalomhomesolutions/sites/default/files/xpress-auto-care-car-sales.png" /><br /><svg height="0" width="0"><br /><defs><br /><clippath id="svgTextPath"></clippath></defs></svg></p> <polygon points="0,50 100,0 100,100" style="fill:none; stroke:purple; stroke-width:1"></polygon><br /><br /> </section>
    <section id="block-block-35" class="block block-block clearfix">      
      <p> <img alt="dog" src="http://godrupal.info/shalomhomesolutions/sites/default/files/xpress-auto-care-car-sales.png" /><br /><svg height="0" width="0"><br /><defs><br /><clippath id="svgTextPath"></clippath></defs></svg></p>
    <polygon points="0,50 100,0 100,100" style="fill:none; stroke:purple; stroke-width:1"></polygon><br /><br />
    </section>

    The polygon is part of the SVG, put it in the defs tag like so:

    <img alt="dog" src="dog.jpg" />
     <svg height="0" width="0">
     <defs>
     <clipPath id="svgTextPath">
     <polygon points="0,50 100,0 100,100" style="fill:none; stroke:purple; stroke-width:1" />
     </clipPath>
     </defs>
    </svg>

    and where the clip-path CSS is? clip-path works in Mozilla (have no idea with Chrome). I attached the script that worked.

     

    If it's still doesn't work, like dsonesuk said, some alternative methods would be great.

    clip path css - 2.html

  2. musicman - I dont know how to make arrow image. my goal is to make the arrow image.

    Hi,

    You can clip an image to svg path like following:

     

    CSS

    img { clip-path: url( #svgTextPath ); }

    HTML

     <img alt="dog" src="dog.jpg" />
     <svg height="0" width="0">
     <defs>
     <clipPath id="svgTextPath">
     <polygon points="0,50 100,0 100,100" style="fill:none; stroke:purple; stroke-width:1" />
     </clipPath>
     </defs>
    </svg>

    It will insert the img to the svg path and the path will crop the img.

    But I suggest to have an individual arrow image in png and then use the CSS content property.

  3. Hi,

     

    My test page works fine in Chrome. I'm using font-face in my CSS:

    @font-face{ font-family:Toba; src:url(styles/fonts/Toba.ttf); }

    but in Mozilla log, I always get this error message:

    downloadable font: download failed (font-family: "Toba" style:normal weight:normal stretch:normal src index:0): status=2147746065 source: ***

    the font never showed up. Well, it succeed sometimes but most time didn't, weird.

    How we use font-face for Mozilla?

     

    Thanks!

×
×
  • Create New...