Insert html code block inside another
Posted: Tue Aug 03, 2004 5:54 pm
Here's a challenge for those night owls in need of a procrastination project.
I have a block of HTML which will always consist of at least one paragraph. This is our large block, lets say 300 words.
Now I have a supplemental block contained within a div which is intended to accompany the main block of text. This div element is set to float:right. this block of text is say 70 words. Now I want the supplemental block to float as near to the bottom of the main copy as possible so the html would look something like:
The tricky part is working out where and how to insert the div block into the larger block. As a rough guide, if we say the div box will be 50% of the width then we need to insert the code block roughly the same number of characters back as there are in the supplemental block from the end of the large block. We can use maths to add or remove percentages later.
The other issue is that we can't have the <div> tag beginning in the middle of an existing tag or between existing pairs of tags (except <p>).
Anyone want to accept the challenge?
I have a block of HTML which will always consist of at least one paragraph. This is our large block, lets say 300 words.
Now I have a supplemental block contained within a div which is intended to accompany the main block of text. This div element is set to float:right. this block of text is say 70 words. Now I want the supplemental block to float as near to the bottom of the main copy as possible so the html would look something like:
Code: Select all
<p>Some text.....<div>supplemental text</div>some more text</p>The other issue is that we can't have the <div> tag beginning in the middle of an existing tag or between existing pairs of tags (except <p>).
Anyone want to accept the challenge?