Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8498717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:28:43+00:00 2026-06-11T00:28:43+00:00

On, for example, GitHub, if you select code it only selects the code not

  • 0

On, for example, GitHub, if you select code it only selects the code not the line numbers next to it:

Text selection limit

This is because they use a table – the line numbers in a td and the code in a td.

How can I achieve this with a div?

EDIT: Please see http://www.duncannz.com and try to highlight text. I want the selection thing to only be inside the content area, not to fill the width of the page (eg selection background doesn’t go past the black border)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:28:44+00:00Added an answer on June 11, 2026 at 12:28 am

    Example: http://jsfiddle.net/gfp28/

    <div>
    
      <ul class='no_select'>
          <li>1</li>
          <li>2</li>
          <li>3</li>
          <li>4</li>
          <li>5</li>
      </ul>
    
      <ul>
          <li>111111111</li>
          <li>222222222</li>
          <li>333333333</li>
          <li>444444444</li>
          <li>555555555</li>
      </ul>
    
    </div>​
    

    CSS:

    ul {
      display: inline; 
      float: left; 
      margin: 10px;
    }
    
    .no_select { 
     -webkit-touch-callout: none;
     -webkit-user-select: none;
     -khtml-user-select: none;
     -moz-user-select: none;
     -ms-user-select: none;
     user-select: none;
    }
    

    If you add this to your css, it should restrict the highlighting to the width of the container:

    #actualcontent, #actualcontent * { position: relative; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

rowanparker https://github.com/rowanparker/kohana-3-paypal I really need this module but I can not use it because
using this example on dynamic list https://github.com/sandeepleo11/Dynamic-Select-Menus-in-Rails-3 I managed to get dynamic select in
i'm tryng to make 7 related select boxes with this script: https://github.com/tukutela/jquery-related-selects , here
IN this example: https://github.com/RailsApps/rails3-devise-rspec-cucumber I get an error because doing visit('/users/sign_out') (in capybara..to ensure
I found that most tutorials use one big router. For example: https://github.com/thomasdavis/backboneboilerplate/blob/gh-pages/js/router.js Wouldn't it
In the example, http://mbostock.github.com/d3/ex/bubble.html : In line 27: .style(fill, function(d) { return fill(d.packageName); });
If I use Moonshine (https://github.com/brandonc/moonshine) on non-English characters - for example if I run
The code is also at https://github.com/timp21337/java-generics-example package a; import java.util.List; public interface Container<T> {
Many data analysts that I respect use version control. For example: http://github.com/hadley/ See comments
Please see this simple CATiledLayer example https://github.com/seanhess/CATiledLayer-Example It consists of one viewController with a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.