PennController for IBEX › Forums › Support › Blank spaces before content in HTML files
- This topic has 4 replies, 2 voices, and was last updated 2 years, 4 months ago by Cascade.
-
AuthorPosts
-
April 27, 2022 at 2:51 pm #8118CascadeParticipant
Hello, I’m having an issue with an HTML file’s body being preceded by many lines of blank spaces, and I’m not sure what’s causing it. We have a good amount of CSS specified before the body tag, but I don’t know why that would push it down so far. Any ideas why this might be happening? It seems to happen for both Message & Form controllers.
Best,
JackApril 27, 2022 at 3:47 pm #8119JeremyKeymasterHi Jack,
It’s a little hard to tell out of context. Do you have a link to your experiment that you could share, here or at support@pcibex.net?
Jeremy
April 28, 2022 at 1:52 pm #8122CascadeParticipantYes, this link should work: https://farm.pcibex.net/p/BjgaAp/
All the options are obligatory, so you have to click on the button on the first page, then click “continue” on the second…the third page is where the issue is.
https://farm.pcibex.net/p/BjgaAp/
Thanks,
JackApril 28, 2022 at 2:31 pm #8123JeremyKeymasterHi Jack,
I would recommend reserving the data-collection link for actual participants, otherwise you might end up with noise submissions from test runs mixed in with valuable submissions from actual participants. The recommended link to share is the demonstration link, which comes with the debugger and a link to edit a copy of the project, which I need to troubleshoot issues. I did look up the database and fetched the demonstration for your project, but you might want to edit your message to not circulate the data collection link
Regarding the formatting issues, it’s coming from the fact that your HTML document is written as a standalone document, whereas it is actually injected as a part of another document when you include it in your experiment. More specifically, your HTML document contains a
body
node and applies CSS rules to allh1
,header
,p
,div
, etc. nodes in the document, which will necessarily also target those outside your HTML document, ie. including the nodes introduced by IBEX and PCIbexWhat you can do is delete the first 5 lines of your HTML document (from
<!DOCTYPE html>
through<title>Passage One</title>
) as well</html>
at the very end. Then replace<body>
with<div class="thisDocument">
and</body>
at the end with</div>
. Finally, prepend every selector in the CSS rules with.thisDocument
, eg replaceh1 { font-size: 2em; }
with.thisDocument h1 { font-size: 2em; }
andh2, h3, h4 { font-size: 1.5em; }
with.thisDocument h2, .thisDocument h3, .thisDocument h4 { font-size: 1.5em; }
, etc. Also make sure to replacebody {
with.thisDocument {
in those rulesYou should be good once you proceed to those edits
Jeremy
April 29, 2022 at 5:35 pm #8136CascadeParticipantThanks!
Jack
-
AuthorPosts
- You must be logged in to reply to this topic.