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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:27:38+00:00 2026-05-26T04:27:38+00:00

<div style=width: 50px;> <div id=theElement style=position: relative; left 25px;>textMuchLongerThan50[</div> </div> document.getElementById(theElement).clientWidth always returns 50,

  • 0
<div style="width: 50px;">
  <div id="theElement" style="position: relative; left 25px;">textMuchLongerThan50[</div>
</div>

document.getElementById(“theElement”).clientWidth always returns 50, which is width of the parent element, while it is obvious the element’s content is much wider

(The element itself actually has this width, but I need to know its “natural” width, i.e. width of its content.)

Experiencing this behaviour in Chrome and IE. If anoyne knew how to determine the actual dimensions of a relatively positioned DIV residing in another DIV with pre-set/limited width…?

  • 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-05-26T04:27:39+00:00Added an answer on May 26, 2026 at 4:27 am

    You are interested in scrollWidth: Example

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

Sidebar

Related Questions

#mydiv { position:absolute; left:0px; top:0px; width:83px; height:83px; } <div id=mydiv></div> That's my style for
<div style=width: 100px; height:50px; line-height:50px; overflow:hidden;> <p>A short line</p> </div> <div style=width: 100px; height:50px;
<div style=width: 300px> <div id=one style=float: left>saved</div><input type=submit id=two style=float: right value=Submit /> </div>
cant make this animation to work var highlight = $('<div class=insert_highlight style=top:25px; left:100px; width:50px;
<style type=text/css> div#foo { background: #0000ff; width: 200px; height: 200px; opacity: 0.30; filter: alpha(opacity
<html> <head> <style type=text/css> div { border:1px solid #000; min-width: 50%; } </style> </head>
'<div id="'+div_id+'" class="widget" style="height:60px;width:110px">\n\ <div class="widget-head ui-widget-header" style="cursor:move;height:20px;width:130px">'+ '<span id="'+span_id+'" style="float:right; cursor:pointer" class="dialog_link ui-icon
I have a DIV with the following style .vplayer-container .logo { position: absolute; bottom:
<!DOCTYPE html> <html> <head> <style type=text/css> #tempc { background-color: #FFFF00; width: 50px; height: 50px;
given the following code <!DOCTYPE html> <html> <head> <title>show stats</title> <style> span.main { position:relative;

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.