473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

stopping the child control from exceeding parent div element

8
i have a div element with a child control in it which gets populated with data

depending on data teh control expands and also the div. if i set the div width the data overflows in the extended control
i need to use clip property
i tried setting it but i am not getting teh result

clip:rect(0 30 30 0);

how do i set the parent and child element
Jan 3 '09 #1
8 5486
drhowarddrfine
7,435 Expert 4TB
This is not a html or css question; or at least I don't know what language you are using.
Jan 3 '09 #2
Atli
5,058 Expert 4TB
Can we see your code?
It's kind of hard to see the problem without it.

Note, that the clip property won't work if you set the overflow property to "visible".
See how it is supposed to work here.
Jan 3 '09 #3
drhowarddrfine
7,435 Expert 4TB
Oops. Talk about jumping the gun. I wasn't thinking when I made my reply.

As Atli said, we need to see the markup or have a link. We also need to know which browser you are using. 'clip' only works in modern browsers and not IE.
Jan 3 '09 #4
Atli
5,058 Expert 4TB
@drhowarddrfine
Are you sure?
I just tested a very basic example in both IE6 and IE7 and they both seemed to do fine with it.

Not that it would greatly surprise me if there were some bugs lurking around that I missed.
Jan 3 '09 #5
drhowarddrfine
7,435 Expert 4TB
I did not try it and I've never used it but here is my reference.

EDIT: A place I cannot link to says this:
Internet Explorer for Windows versions up to and including 7 do not support the recommended syntax for the rect() notation. However, they do support a deprecated syntax where the arguments are separated by whitespace rather than commas.
Internet Explorer for Windows versions up to and including 7 don’t support the value inherit.
Jan 3 '09 #6
Atli
5,058 Expert 4TB
Ok, I see.

After messing around a bit more with my code, I can confirm that quote.
Without the commas, it works with IE6 and IE7, but then it won't validate. If that doesn't bother you, all the other browsers also accept the comma-free version.

However, if you throw IE into quirks-mode (by omitting the doctype, for instance), it suddenly starts working with the standard method.
It's like they are ignoring the standards on purpose...
Jan 3 '09 #7
drhowarddrfine
7,435 Expert 4TB
@Atli
Of course they are! Always have. IE is the worst browser on the planet.
Jan 3 '09 #8
Nicodemas
164 Expert 100+
Try explicitly defining the width and placing an overflow:hidden; CSS propery on the parent element.

Expand|Select|Wrap|Line Numbers
  1. <!-- if this were the parent div -->
  2. <div id="parentDiv" style="width: 500px; overflow:hidden;">
  3.    <[data]>
  4. </div>
  5.  
Jan 5 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Rob T. | last post by:
Given the following in a stylesheet: #parent { width: 50px; height: 50px; } #child {
13
by: Stuart McGraw | last post by:
I haven't been able to figure this out and would appreciate some help... I have two tables, both with autonumber primary keys, and linked in a conventional master-child relationship. I've...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
2
by: JohnR | last post by:
Let's say I have an MDI parent form with a textbox. If I create an MDI child form and, at runtime, move the MDI child window over the textbox on the MDI parent, the textbox appears in front of the...
1
by: adamredwards | last post by:
I have a page with some form elements that are dynamically generated. They are inserted into the dom by first cloning a node, changing the values like name, and then inserted with insertBefore(). ...
4
by: patrizio.trinchini | last post by:
Hi all, I'm new to XSLT and maybe my problem have a very trivial answer, but I need an expert that point me in the right direction. What I would obtain is to remove all the elements that have a...
7
by: dweeti | last post by:
Hi, I am trying to display the child element in the DOM, while hiding the parent using JS and CSS, however I cannot find a way to do this. So for example: <body> <div id="Parent"> <div...
2
by: Claudia Fong | last post by:
Hi, I have a xml document which is like this: <profile document> <Child name = profile1 id = 1> </Child> </profile document>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.