1

So currently I am importing text as an object tag as so:

<object width="100%" height="500" data="M2History.txt" >

however when doing this, I currently am not getting any styles applied to the text, and its pasting into my site in a default format. When it gets imported it does as: <pre style="word-wrap: break-word; white-space: pre-wrap;">

I tried to do styling on pre, but it doesn't seem to be doing anything. Can someone help with this? I have also tried to style other elements, such as body and object tags but to no avail.

AdsSal
  • 11
  • 2

1 Answers1

0

You can add styles to an object element (not to it's inner content) with specific data attribute this way:

data=["M2History.txt"] {
  border: 1px solid #000;
  margin: 20px;
}

You cannot access object's inner content because this is iFrame, so CSS has no power. Please, check this question, it could be helpful. Good luck! P.S. guide to data attributes here

ko1ebayev
  • 21
  • 5