Wednesday, 15 January 2014

php - html size to fit content of object -


I'm using the [object] tag to display the text of the .txt file. The object is within a div When the object sets the text in a frame, which I can define the height and width. However, setting the height in auto, or 100% does nothing, with scroll bars, whatever area I text is displayed is small.

  & lt; Object type = "text / html" data = "./docs / description_a.html" style = "width: 100%;" & Gt; & Lt; / Object & gt;   

But no matter what I do, I can not spread it based on the length of the text. Any help is greatly appreciated.

You can use jQuery to set dynamically Height and Width:

  $ (document) .ready (function () {$ ("# obj") width ($ ("# cont"). Width ()); $ (" #obj ") height ($ (" # cont "). Height ());});   

HTML:

  & lt; Div id = "cont" & gt; & Lt; Object id = "ozzy" width = "height" = "" data = "www.google.com" & gt; & Lt; / Object & gt; & Lt; Div & gt;   

Solution 2

  & lt; Div & gt; & Lt; Object width = "600" height = "900" data = "www.google.com" & gt; & Lt; / Object & gt; & Lt; Div & gt;   

css

  div {height: 600px; Width: 900px; }    

No comments:

Post a Comment