Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Html Problem
~.MadLock.~
post Jun 7 2008, 10:54 AM
Post #1


Newbie [Level 2]
**

Group: Members
Posts: 26
Joined: 6-June 08
Member No.: 63,243



how to make my intro page in the middle not CENTER
Go to the top of the page
 
+Quote Post
jlhaslip
post Jun 7 2008, 02:46 PM
Post #2


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,081
Joined: 24-July 05
From: Linix, DOS and Windows…the good, the bad and the ugly
Member No.: 9,787
Spam Patrol



Can you post some code, please.

And do you mean vertically centred on the page instead of horizontally centred?
Go to the top of the page
 
+Quote Post
Erdemir
post Jun 7 2008, 05:17 PM
Post #3


Super Member
*********

Group: [HOSTED]
Posts: 217
Joined: 12-May 08
From: Istanbul, Turkey
Member No.: 62,045



You can use this html codes
CODE
<div style="position:absolute; top:45%">

YOUR CONTENT HERE

</div>


Attention! If the size of your content is 10% of page height then use 50-10/2 = 45 so use 45% at value of "top:"
One more example if the percentage if 25% then 50-25/2 =~ 38 so use %38 at value of "top:"

This post has been edited by Erdemir: Jun 7 2008, 05:22 PM
Go to the top of the page
 
+Quote Post
etycto
post Jun 7 2008, 07:11 PM
Post #4


Super Member
*********

Group: [HOSTED]
Posts: 275
Joined: 2-June 07
From: U to the S to the A (but i'm haitian)
Member No.: 44,040



absolute positioning can make the pages look kinda funky. like jlhaslip said posting codes could help us help you more.

you can try using the the margin and padding tag i think it could do the job CHECK HERE
Go to the top of the page
 
+Quote Post
majklisko
post Jun 7 2008, 08:21 PM
Post #5


Newbie [Level 1]
*

Group: [HOSTED]
Posts: 21
Joined: 31-October 07
Member No.: 52,277



I'd do it this way:
Make this div tag:
CODE
<div id="whole_content" style="position:absolute;">

content

</div>

write this java script:

&lt;script type="text/javascript">
var height={write here the height of the element you wanna put in the middle of the page};

document.getElementById('whole_content').style.left=Math.round((screen.height-height)/2)+'px';

</script>

Notice from jlhaslip:
added code tags
Go to the top of the page
 
+Quote Post
jlhaslip
post Jun 8 2008, 02:30 AM
Post #6


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,081
Joined: 24-July 05
From: Linix, DOS and Windows…the good, the bad and the ugly
Member No.: 9,787
Spam Patrol



Use absolute positioning to centre the div to the 50%/50% location. this will place the top left of the div at the centre of the display. Then apply negative top margins to the div which is one half of the div's height, and apply a negative left margin of one half of the div's width.
results will be as per this sample page:

http://www.jlhaslip.trap17.com/samples/mis...entereddiv.html

TYhe css for the div will look something like this:
CODE
#mydiv {
    position:absolute;
    top: 50%;
    left: 50%;
    width:30em;
    height:18em;
    margin-top: -9em; /*set to a negative number 1/2 of your height*/
    margin-left: -15em; /*set to a negative number 1/2 of your width*/
    border: 1px solid #ccc;
    background-color: #f3f3f3;
}
Go to the top of the page
 
+Quote Post
~.MadLock.~
post Jun 8 2008, 03:41 AM
Post #7


Newbie [Level 2]
**

Group: Members
Posts: 26
Joined: 6-June 08
Member No.: 63,243



here's the file of my intro can anyone here fix this for me thx ^^

http://www.filecrunch.com/fileDownload.php...p;fileId=154761
Go to the top of the page
 
+Quote Post
jlhaslip
post Jun 8 2008, 04:28 AM
Post #8


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,081
Joined: 24-July 05
From: Linix, DOS and Windows…the good, the bad and the ugly
Member No.: 9,787
Spam Patrol



QUOTE
This file is a private File. So you don't have rights to download this file.


It does not like me.
Go to the top of the page
 
+Quote Post
~.MadLock.~
post Jun 8 2008, 07:29 AM
Post #9


Newbie [Level 2]
**

Group: Members
Posts: 26
Joined: 6-June 08
Member No.: 63,243



oh... sry for that

you can try it now ^^
Go to the top of the page
 
+Quote Post
Live-Dimension