Why when using divs you cannot select individual text.

Posted on 2004-11-10
Last Modified: 2010-04-06
I noticed since i moved to divs instead of using tables for layout of my pages, that text is no longer selectable, sometimes you can select a paragraph, but most of the time if i drag and highlight I get half the page or some wiered selection of parts.

Why is this?


What am I doing wrong,


How can design my pages better to allow for text to be selectable down the character.

Question by:redcable
    LVL 53

    Expert Comment

    It's the nature of the beast. They are different elements with different characteristics; why you expect them to behave the same way?  


    Author Comment

    uh I dont expect them to work the same way. just a little insight on if im doing things correct, or there is a better way to do them to be a better designer. hense...

    why is this,

    what am i doing wrong

    and how can i design my pages better to allow for text to be selectable down to the character.

    LVL 53

    Expert Comment

    If you show a sample of the code I'll be happy to look at it and see if there is anything wrong with it.

    LVL 10

    Accepted Solution

    The general idea is that text is selectable in the order it appears in the HTML file, rather than how it appears on screen.

    If you have a div in the bottom right of the screen, followed by a div in the top left, drag-selecting from the middle of each div will select the last bit of the bottom right and the first bit of the top left (I hope that made sense)

    IE has a bug which rears its head occasionally, whereby you can't select a block of text in the middle of a page. Instead, selecting anything will select everything from the start of the page to the cursor position, however I don't know under what circumstances this appears.


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Shoutout to Emily Plummer ( for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
    Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now