Note that there are some explanatory texts on larger screens.

plurals
  1. POinclude a html page, and discard css style after page has rendered
    primarykey
    data
    text
    <p>How can I include a file, but 'forget' everything about it after it has been included and rendered; contain it, so to speak.</p> <p>Back in the day, I guess I would have just used a frame but now times have changed. I suppose an iframe is still fair game.... but are there any other ways?</p> <p>p.s. <em>I can't edit the included file :).</em></p> <p><strong>index.php</strong></p> <pre><code>&lt;?php echo '&lt;p&gt;This is some left-aligned text&lt;/p&gt;'; include 'include.html'; echo '&lt;p&gt;This is some more left-aligned text&lt;/p&gt;'; ?&gt; </code></pre> <p><strong>include.html</strong></p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;style&gt; body{ text-align:center; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt;This is some centered text&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>Output</strong></p> <pre><code> This is some left-aligned text This is some centered text This is some more left-aligned text </code></pre> <p><strong>Desired Output</strong></p> <pre><code>This is some left-aligned text This is some centered text This is some more left-aligned text </code></pre> <p><strong>'Ultimate' Objective</strong> Just to give some more information, I have an epub file. I load the container.xml to determine the root file which is a .opf file which tells me the spint, which contains lots of .html file...</p> <p>I am then including all of these html files into the page so that an epub can be read in one continuous flow.</p> <p>The epub files cannot be edited? Unless I can do this without modifying the epub files permanently.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload