• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved [Webdesign] Site flexibility problem

Shadowsong

Game Developer & Graphic Designer
Joined
Feb 23, 2010
Messages
3,446
Solutions
21
Reaction score
3,001
Location
Bosnia & Herzegovina
YouTube
ShivaShadowsong
Hi! I've recently been re-designing the layout for my server's website and we're also using an entrance index page (before you get to the actual website content). However, I encountered a problem here. The page consists of 4 buttons aligned over a background which look completely fine in 1024x768 and lower resolutions. However, on bigger resolutions, the background shrinks in (which is fine), while the buttons don't - they actually stray to the left, thus becoming misplaced in comparison to their original position.

1024x768: see picture
Bigger: see picture
Even more bigger: see picture

Now, I searched google and stuff already, read about it a little, and it turns out that you have to define the positions in <div>'s or css styled elements in which you insert those buttons to make their position become the one you defined, however I've never before worked with such stuff and it would take me some time to learn how to do it which I don't have right now, and that's why I'm asking on OTLand - is there anyone who can help me or at least give direct explanation how to solve this problem?

If you want to see the site for yourself, see necronia.com, and the index.html is here:

HTML:
<html>
<script type="text/javascript">
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>

<body>
<title>Necronia NW</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Imagetoolbar" content="yes">
<style type="text/css">
html {height:100%;}
body {width:100%; margin:0; padding:0; text-align:center; background:#000 url('backgroundpage.png') no-repeat center;}
#bg {position:fixed; top:5; left:3; width:100%; height:95%;}
</style>


<a href="http://necronia.freeforums.org" target="_blank" onMouseDown="MM_swapImage('ForumButton','','ForumButton_Pressed.png',1)" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('ForumButton','','ForumButton_onRollOver.png',1)">
<img src="ForumButton.png" alt="NNW Forum" width="201" height="55" id="ForumButton" 
style="position: absolute; left: 40.5%; top: 18%" /></a>

<a href="http://www.facebook.com/necronia" target="_blank" onMouseDown="MM_swapImage('FaceButton','','FaceButton_Pressed.png',1)" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('FaceButton','','FaceButton_OnRollOver.png',1)">
<img src="FaceButton.png" alt="Necronia's Facebook Page" width="201" height="55" id="FaceButton" 
style="position: fixed; left: 15.05%; top: 18%" /></a>

<a href="http://www.youtube.com/user/NecroniaNW/videos" target="_blank" onMouseDown="MM_swapImage('YTButton','','YTButton_Pressed.png',1)" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('YTButton','','YTButton_OnRollOver.png',1)">
<img src="YTButton.png" alt="Necronia's Videos" width="201" height="55" id="YTButton" 
style="position: fixed; left: 65.25%; top: 18%" /></a>

<a href="index2.php" target="_blank" onMouseDown="MM_swapImage('EW','','EW_pressed.png',1)" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('EW','','EW_roll.png',1)">
<img src="EW.png" alt="Enter World" width="450" height="95" id="EW" 
style="position: absolute; left: 27.50%; top: 73%" /></a>


</body>

</html>
 
Last edited:
that's why you aren't using any type of content made in css, sothe main content is the screen, and if screen changes the buttons change with them
 
please man, don't use Dreamweaver, use notepad and his knowledge.
HTML:
<html>
  <head>
    <title>Necronia NW</title>
    <style type="text/css">
      body { background-color: 0; margin:0; padding:0; }
      #wrapper { margin: 0 auto; width: 1124px; height: 868px; background: url('http://necronia.com/backgroundpage.png') no-repeat center center; }
      .enter { position:relative; top:600; left: 350; width: 450px; height:95px; background: url('http://necronia.com/EW.png') no-repeat; }
      .enter:hover { background: url('http://necronia.com/EW_roll.png') no-repeat; }
      .enter:active { background: url('http://necronia.com/EW_pressed.png') no-repeat; }
      
      .enter { position:relative; top:600; left: 350; width: 450px; height:95px; background: url('http://necronia.com/EW.png') no-repeat; }
      .enter:hover { background: url('http://necronia.com/EW_roll.png') no-repeat; }
      .enter:active { background: url('http://necronia.com/EW_pressed.png') no-repeat; }
      
      .buttons { position: relative; top: 150px; left: 200px; margin: 0 auto;}
      .buttons a { float:left; margin: 0 30px;}
      .size { width:201; height:55px; }
      
      .forum { background: url('http://necronia.com/ForumButton.png') no-repeat; }
      .forum:hover { background: url('http://necronia.com/ForumButton_onRollOver.png') no-repeat; }
      .forum:active { background: url('http://necronia.com/ForumButton_Pressed.png') no-repeat; }
      
      .face { background: url('http://necronia.com/FaceButton.png') no-repeat; }
      .face:hover { background: url('http://necronia.com/FaceButton_OnRollOver.png') no-repeat; }
      .face:active { background: url('http://necronia.com/FaceButton_Pressed.png') no-repeat; }
      
      .youtube { background: url('http://necronia.com/YTButton.png') no-repeat; }
      .youtube:hover { background: url('http://necronia.com/YTButton_OnRollOver.png') no-repeat; }
      .youtube:active { background: url('http://necronia.com/YTButton_Pressed.png') no-repeat; }
      
    </style>
  </head>
  <body>
    <div id="wrapper">
    <div class="buttons">
        <a href="http://necronia.freeforums.org/portal.php"><div class="forum size"></div></a>
        <a href="https://www.facebook.com/necronia"><div class="face size"></div></a>
        <a href="http://www.youtube.com/user/NecroniaNW/videos"><div class="youtube size"></div></a>
    </div>
    <a href="http://necronia.com/index2.php"><div class="enter"></div></a>
    </div>
  </body>
</html>
 
Last edited by a moderator:
Alright I'll try out the tips you guys gave me and post results back asap, thanks!

- - - Updated - - -

please man, don't use Dreamweaver, use notepad and his knowledge.
HTML:
<html>
  <head>
    <title>Necronia NW</title>
    <style type="text/css">
      body { background-color: 0; margin:0; padding:0; }
      #wrapper { margin: 0 auto; width: 1124px; height: 868px; background: url('http://necronia.com/backgroundpage.png') no-repeat center center; }
      .enter { position:relative; top:600; left: 350; width: 450px; height:95px; background: url('http://necronia.com/EW.png') no-repeat; }
      .enter:hover { background: url('http://necronia.com/EW_roll.png') no-repeat; }
      .enter:active { background: url('http://necronia.com/EW_pressed.png') no-repeat; }
      
      .enter { position:relative; top:600; left: 350; width: 450px; height:95px; background: url('http://necronia.com/EW.png') no-repeat; }
      .enter:hover { background: url('http://necronia.com/EW_roll.png') no-repeat; }
      .enter:active { background: url('http://necronia.com/EW_pressed.png') no-repeat; }
      
      .buttons { position: relative; top: 150px; left: 200px; margin: 0 auto;}
      .buttons a { float:left; margin: 0 30px;}
      .size { width:201; height:55px; }
      
      .forum { background: url('http://necronia.com/ForumButton.png') no-repeat; }
      .forum:hover { background: url('http://necronia.com/ForumButton_onRollOver.png') no-repeat; }
      .forum:active { background: url('http://necronia.com/ForumButton_Pressed.png') no-repeat; }
      
      .face { background: url('http://necronia.com/FaceButton.png') no-repeat; }
      .face:hover { background: url('http://necronia.com/FaceButton_OnRollOver.png') no-repeat; }
      .face:active { background: url('http://necronia.com/FaceButton_Pressed.png') no-repeat; }
      
      .youtube { background: url('http://necronia.com/YTButton.png') no-repeat; }
      .youtube:hover { background: url('http://necronia.com/YTButton_OnRollOver.png') no-repeat; }
      .youtube:active { background: url('http://necronia.com/YTButton_Pressed.png') no-repeat; }
      
    </style>
  </head>
  <body>
    <div id="wrapper">
    <div class="buttons">
        <a href="http://necronia.freeforums.org/portal.php"><div class="forum size"></div></a>
        <a href="https://www.facebook.com/necronia"><div class="face size"></div></a>
        <a href="http://www.youtube.com/user/NecroniaNW/videos"><div class="youtube size"></div></a>
    </div>
    <a href="http://necronia.com/index2.php"><div class="enter"></div></a>
    </div>
  </body>
</html>

You sir, are a gentleman and a scholar. This is exactly what I needed, thank you very much, and thanks to other who threw in tips. I'll head deeper into CSS and HTML coding a bit later so this will be good to know.
 
Back
Top