Hi I have this html page containing some links in it which are at the extreme left of the page.I want to move the entire content to the extreme right top of the page.Can someone guide me on how do I do it.Thanks I am new to css.
<html>
<body>
<script type="text/javascript">
var str="732176086,732176085,735219154,735219155,23948614,23948629,23948628,764488973,764488974,764488975,23948631,732164301,732164304,732164305,732164303,732164302,732168040,832567989,832567988,807573121,807573120,765867299,831150154,831150153,23951065,23952295";
var str_array=str.split(',');
for(var i=0;i<str_array.length;i++)
{
controlRef = document.createElement('a');
var newLine=document.createElement('br');
document.body.appendChild(newLine);
controlRef.href = '#';
controlRef.innerHTML = str_array[i];
controlRef.onclick = (function(element) {
return function() {
alert(element.innerHTML);
};
})(controlRef);
document.body.appendChild(controlRef);
}
</script>
</body>
</html>
Generally this is done through CSS. A very quick example would be to wrap all your anchor tags in a div tag with a style property of float: right. For example…
select the div with
document.getElementById("myDiv").appendChild(controlRef)rather than appending to the body.Note there are many other ways to achieve this, and generally you should not be manipulating the DOM like this. It should instead be put in a window.onload or body onLoad event, an init function.