<style type="text/css">
fieldset {
border: solid 1px orange
}
.label {
font-family: Arial;
font-size: 12px;
font-weight: bold
}
.groupName {
font-family: Segoe UI;
font-size: 16px;
color: Gray
}
</style>
<script type="text/javascript" src="libs/json2.js"></script>
<script type="text/javascript" src="libs/jquery.js"></script>
<script type="text/javascript" src="libs/sap.common.globalization.js"></script>
<script type="text/javascript" src="libs/sap.riv.base.js" base-url="modules/"></script>
<script type="text/javascript" src="modules/main.js"></script>
<script type="text/javascript" src="libs/sap.riv.themes.js"></script>
</head>
<body>
<div id="chart" style="width: 600px; height: 400px; background-color: #ffffff"><div id="0" style="position: absolute; font-size: 10px; box-sizing: border-box; overflow-x: visible; overflow-y: visible; left: 8px; top: 8px; width: 600px; height: 400px; ">`
In chrome I can see
body{
display:block;
margin: 8px;
}
I use document.getElementsByTagName('body').style but get nothing.
my first div located at top&left: 8px of the html body.
But it does have margin, how could I get this default margin value?
document.getElementsByTagName('body') returns an array on success.
To get rid of the margin in the body use normal css
body{
margin: 0;
}
EDIT: I found this function that can give you the styles of elements on quirksmode
function getStyle(el,styleProp)
{
if (el.currentStyle)
var y = el.currentStyle[styleProp];
else if (document.defaultView && document.defaultView.getComputedStyle)
var y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);
return y;
}
Fiddle1 Fiddle2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With