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 8012627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:22:52+00:00 2026-06-04T19:22:52+00:00

How can i add css border-right after a specific position using javascript. As for

  • 0

How can i add css border-right after a specific position using javascript. As for example take this :

<div id="test"></div>

<style>
  #test {
    background-color : red;
    height : 30px;
    width : 200px;
  }
</style>

We can add css style using javascript but if i want to add css border-right after 100px in #test then how can i do that. As in the example http://jsfiddle.net/zUxmd/1/ i have added css border using javascript but if i want to add it after a specific px value how can i do it. Any help would be great.

Update :
I have the following div structure

<div id=test>
 <div id="1"></div>
 <div id="2"></div>
<div>

The width for #1 and #2 is calculated in javascript and the sum of the width is set to #test. Suppose now if the total width is 188px i want to visually distinguish where is 100px just like the demo http://jsfiddle.net/zUxmd/2/ prepared by tom. Is this possible in any way just like adding marker to that position. But i dont want to add any extra dummy div.

EDIT :
The demo http://jsfiddle.net/davidThomas/zUxmd/7/ put up by david is exactly what i want. Any better idea would be appreciated.

  • 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-04T19:22:55+00:00Added an answer on June 4, 2026 at 7:22 pm

    If I understood correctly, I would add an inner div: http://jsfiddle.net/zUxmd/1/

    Html:

    <div id="test">
        <div class="inner">
        </div>
    </div>​​​​​​​​​
    

    Css:

    #test{
     background-color:red;
     height: 30px;
     width: 200px;    
    }
    #test .inner {
        height: 100%;
        width: 100px;
    }
    

    Js:

     $(document).ready(function(){
       $('#test .inner').css('border-right','2px solid blue');
     });
    

    UPDATE

    Here is another possibility using background image, the idea is to use a 1px x 1px blue dot, but I couldn’t find that image 😛

    http://jsfiddle.net/zUxmd/5/

    Html:

    <div id="test"></div>​ 
    

    Css:

    #test{
      background-color:red;
      height: 30px;
      width: 200px;
    }
    #test.limit {
      background-image: url("http://www.scratchingpostgazette.com/forum/styles/Blue-Crush/theme/images/blue.gif");
      background-repeat: repeat-y;
      background-position: 100px 0;
    }
    

    ​
    Js:

    $(document).ready(function(){
      $('#test').addClass('limit');
    });
    

    ​

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I add a css file to only a child page while using
Is there a way I can put a link inside a div using c#/css
I need some JQuery code so that I can add a CSS border to
How can I do to add a css rule for all textbox ? I
Can someone explain how can I add custom font, css classes styles to Contribute?
You can add as many text boxes as you want as shown by using
We can add an image to an photo album using UIImage *img = [UIImage
I have this html: <div class=warning> <span>text text text</span> </div> and this css: .warning
How would I add next/previous buttons to this snippet, cause as you can see
I have a main content area div that has a border. Inside this area

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.