Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Position relative ignored in innerHTML
Message
From
26/02/2017 12:14:37
 
 
To
26/02/2017 05:49:42
General information
Forum:
CSS
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01648528
Message ID:
01648536
Views:
24
>Hi Michel
>you can apply any style to the extracted innerhtml putting it in an element div or others.
>this is an example with javascript using DOM syntaxe .its also very usefull from foxpro to traverse the document and all its childs(particulary for applying css/css3 styles).
>
><script>
>function yf(){
>var x=document.getElementById("odiv").innerHTML;
>var y=document.getElementById("yb");
>
>y.innerHTML=x;
>y.style.border="thick solid #0000FF";
>
>y.style.padding="5px";
>y.style.position ="absolute" ;      
>y.style.left="300px" ;
>y.style.width="350px" ;
>}
></script>
>
><div id="odiv">
><h2>This is a div  with an absolute position</h2>
><img src="https://www.levelextreme.com/thread/00079336.jpg" width='100' height='100'>
><p id="yb1" >With absolute positioning, any element can be placed anywhere on a page. The div below is placed 300px from the left of the page and 350px from the top of the page.
>All styles can be done with DOM syntax (even out of javascript ,from visual foxpro codings).
>for more info:can search in  https://www.w3schools.com/   (very usefull).
></p>
></div>
><hr>
><div id='yb'></div>
><br>
><button style="cursor:pointer;float:right;" onclick="yf()">Click me</button>
>
>
>
Thanks

Here is a sample code to simulate the behavior. I removed everything that was not necessary and went inline. When you click on Test, you will see a rectangle. The X should be upper right. It is, when this is not sent to innerHTML. But, in that example, we are using innerHTML as this is done through Javascript.

In order to avoid the bug, I just found out this is caused by the DOCTYPE declaration. But, that has to sit on the main document. I just don't know why using such approach would conflict with that declaration in such case. Do you understand anything in all that?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform