CSS: How to make selectable boxes?

Tags: javascript,css

Problem :

Say I have a 200x200 image. Then say I want to have a "box" starting at the coordinates 20px by 20px all the way to 50px by 50px (basically, a 30x30 box). I want users to be able to "select" this 30x30 box, like the way GMail's PDF viewer allows user to select boxes containing text.

In this box, I want to put text -- but I don't want this text to be selectable (thus, allowing users to select individual characters, etc.). I only want the containing box to be selectable -- and when user copies, they copy the text inside.

Is this possible in CSS? If so, how?

Solution :

No, its not possible with css, you will to manipulate images using javascript. Have a look at jquery and the plugins available, ou may find something that can style up checkboxes to suit your requirements.

    CSS Howto..

    Bootstrap 3 - How to change the hyperlink title text showing as tooltip using javascript/jquery?

    How does CSS computation for background percentages work?

    how to place div next to centered div css

    How to center images vertically these divs?

    How to make child span collapse with parent

    how do i align contact form 7 next to text

    How to place buttons next to each other using css Bootstrap

    How to add padding to the outside of an input in css

    Showing HTML page with CSS attached in a WebView

    How to fix crispy text in Safari 5 Mac OS X after using css 3d transforms?

    How to layout list items in groups

    how to add class with animation?

    How to use position in CSS?

    How to give all divs same amount of space on each side

    How do I organize imports in Compass/Blueprint?

    How to build those rectangular with picture and text css bootsrap? [closed]

    How to clip inside a box in css?

    How to position a div that already has a float?

    How can I get an image to always appear to the right of some associated text using HTML and/or CSS?

    How to make submenus drop down below parent menu, instead of flying out?

    How to Rotate Text and have it's Parent Div act Dynamically

    How to animate border transition expand with CSS?

    How to display sub sub menu to the left side using CSS?

    how to CSS center a div, which is the child of a form element?

    How to prevent mobile device to resize and use proper css file

    How do I fix this simple CSS floating issue in IE?

    How can I have an image float next to a centered div?

    how I can set color of anything in css [closed]

    How or where to add javascript settimeout function to CSS vertical drop down menu

    Show background image out of the div [closed]