Logout Developer Knowledgebase Search Adobe Partners Main Adobe Solution Partner Finder Adobe Solution Partner Program Support Developer Knowledgebase Adobe Solution Partner Program Products & Technology Adobe
Developer Knowledgebase

Knowledgebase HomeSVG KB

Overview
Software Development Kits
Developer Knowledgebase
Support
Legal Notices
Feedback
Adobe Solution Partner Program
Join
Find a Solution Partner

Product
SVG
 
Version
3.0
 
Last Edited
11-Oct-2002
 
Document
52492

How To: How to make text unselectable

ISSUE
How can I make text in my SVG image unselectable?

SOLUTION

You have to draw a rectangle with fill="none" completely over the text you wish to prevent pointer-events="all". An example is below:

<svg width="250" height="200">

<g id="non_selectable_text">
<text font-family="Arial" font-size="25" x="30" y="30">I can't select this</text>
<rect x="30" y="4" width="190" height="30" fill="none" stroke="blue" pointer-events="all"/>
</g>
<g id="selectable_text">
<text font-family="Arial" font-size="25" x="30" y="70">But I can select this</text>
</g>
</svg>


For more information on pointer-events, see chapter 16.6 "The 'pointer-events' property" of the SVG Specification available from the W3C site http://www.w3.org/TR/2001/REC-SVG-20010904

back to top
Was this Knowledgebase document helpful? Yes  No
The articles in this knowledgebase are intended for use by software programmers currently using an Adobe SDK to extend or customize an Adobe product. These articles may be highly technical in nature.
If you have questions about an Adobe Product that are not related to development or an SDK product please visit: http://adobe.com/support/main.html
Copyright © Adobe Systems Incorporated. All rights reserved.
Terms of Use
Online Privacy Policy