HighDots Forums  

enforcing margins by munging existing document

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss enforcing margins by munging existing document in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andy
 
Posts: n/a

Default enforcing margins by munging existing document - 10-24-2009 , 05:41 PM






Hi,

I am showing existing html documents in an iframe. These documents
are allowed to have any css for body and subelements that they wish,
as well as inline styles, so that they are in control of their own
margins.

What I would like to do is have a failsafe way to munge the document,
changing it by adding margin space on the left and right of 50px each.

My idea is that I have to parse the existing css rules for body, if
any and save them. Then I have to insert my own div tag between
<body> and </body> which takes the existing doc's body css and applies
it to my inserted div. Then I have to strip all of the body css from
the munged document, and make it have my own margins. Is this going
to work?

If so, can anyone tell me details that I've overlooked, and/or some
example css.

Andy

Reply With Quote
  #2  
Old   
dorayme
 
Posts: n/a

Default Re: enforcing margins by munging existing document - 10-24-2009 , 07:05 PM






In article
<d706bcb1-9a7f-417f-8fbc-639f28ed6fa9 (AT) y10g2000prg (DOT) googlegroups.com>,
Andy <p7eregex (AT) gmail (DOT) com> wrote:

Quote:
Hi,

I am showing existing html documents in an iframe. ...

What I would like to do is have a failsafe way to munge the document,
changing it by adding margin space on the left and right of 50px each.

Why do you want to do this in particular? Are you wanting to improve the
original author's plan? For what purpose exactly? So it somehow stands
out better on *your* page? If so, what is the difficulty, just use your
own padding and margin on the element that contains the iFrame. Sure,
the iFrame is an inline element. But it can be the only resident of a
block element if you wish.

Quote:
My idea is that I have to parse the existing css rules for body, if
any and save them. Then I have to insert my own div tag between
body> and </body> which takes the existing doc's body css and applies
it to my inserted div. Then I have to strip all of the body css from
the munged document, and make it have my own margins. Is this going
to work?

If so, can anyone tell me details that I've overlooked, and/or some
example css.

You forgot, as usual, to give a URL of an example of "before" and, in
relation to this specific and concrete 'before', to give a detailed
description of what you would like changed.

--
dorayme

Reply With Quote
  #3  
Old   
Ben C
 
Posts: n/a

Default Re: enforcing margins by munging existing document - 10-26-2009 , 11:58 AM



On 2009-10-24, dorayme <doraymeRidThis (AT) optusnet (DOT) com.au> wrote:
Quote:
In article
d706bcb1-9a7f-417f-8fbc-639f28ed6fa9...oglegroups.com>,
Andy <p7eregex (AT) gmail (DOT) com> wrote:

Hi,

I am showing existing html documents in an iframe. ...

What I would like to do is have a failsafe way to munge the document,
changing it by adding margin space on the left and right of 50px each.


Why do you want to do this in particular? Are you wanting to improve the
original author's plan? For what purpose exactly? So it somehow stands
out better on *your* page? If so, what is the difficulty, just use your
own padding and margin on the element that contains the iFrame. Sure,
the iFrame is an inline element. But it can be the only resident of a
block element if you wish.
Or use marginwidth and marginheight on the IFRAME which do exactly what
the OP wants, strange though it sounds, which is effectively to put
margins on the BODY of the document inside the IFRAME.

Reply With Quote
  #4  
Old   
dorayme
 
Posts: n/a

Default Re: enforcing margins by munging existing document - 10-26-2009 , 08:22 PM



In article <slrnhebhpn.3be.spamspam (AT) bowser (DOT) marioworld>,
Ben C <spamspam (AT) spam (DOT) eggs> wrote:

Quote:
On 2009-10-24, dorayme <doraymeRidThis (AT) optusnet (DOT) com.au> wrote:
In article
d706bcb1-9a7f-417f-8fbc-639f28ed6fa9...oglegroups.com>,
Andy <p7eregex (AT) gmail (DOT) com> wrote:

Hi,

I am showing existing html documents in an iframe. ...

What I would like to do is have a failsafe way to munge the document,
changing it by adding margin space on the left and right of 50px each.


Why do you want to do this in particular? Are you wanting to improve the
original author's plan? For what purpose exactly? So it somehow stands
out better on *your* page? If so, what is the difficulty, just use your
own padding and margin on the element that contains the iFrame. Sure,
the iFrame is an inline element. But it can be the only resident of a
block element if you wish.

Or use marginwidth and marginheight on the IFRAME which do exactly what
the OP wants, strange though it sounds, which is effectively to put
margins on the BODY of the document inside the IFRAME.
Yes, you would think this is what might do. But afaik, it looks a bit
unreliable and indefinite and seems to depend on the site embedded and
often seems to have no effect. Perhaps we might swap URLs and liven this
joint up. <g>

--
dorayme

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.