BleepingComputer.com: Ap Div Alignment

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Ap Div Alignment

#1 User is offline   Sp0nge 

  • Distinguished Member
  • PipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 643
  • Joined: 24-October 06
  • Gender:Male
  • Location:Sydney, Australia

Posted 24 January 2008 - 04:05 PM

Hi,

yep im back for more questions hehe

i can't believe i didn't put a topic in here straight away when I had the problem, I went to another forum that had significantly less users. stupid me :flowers:

Anyway, here's the site:

TeamNyteStroke's Contact Page Gone Bad

As you can see the text there says:

"Under Construction".

It's absolutely positioned, so when you resize the window, it appears to be staying in the exact same spot. Which is technically what it should be doing, right? but not what i want it to be doing.

If someone could take a look at the code for me, and try to explain why/how to fix this, so it stays centered in the middle of the screen even when you resize the window.

Thanks very much to anyone who can help out! :thumbsup:

~Pat

::EDIT::

Oh yeah, im using Dreamweaver to make the content + Photoshop for the images

This post has been edited by Sp0nge: 24 January 2008 - 04:07 PM


#2 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,604
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 24 January 2008 - 05:17 PM

Try This:
#Layer3 {
	position:absolute;
	top: 50%;
	left: 25%;
	width: 50%;
	height: 50%; 
}


You may have to fudge the 'top' number a bit to get it where you want, otherwise that works in Firefox.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#3 User is offline   Sp0nge 

  • Distinguished Member
  • PipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 643
  • Joined: 24-October 06
  • Gender:Male
  • Location:Sydney, Australia

Posted 24 January 2008 - 05:41 PM

Thank you for your response.

You solved the issue of the increasing size :thumbsup: Thanks

Works both in internet explorer and firefox

When I size it smaller, like, much smaller, it scrunches up. Is this happening to the text and not the images because the DIV has not "hit" the side yet whereas the images have? and is there a way to fix that.

Sorry if im sounding like a perfectionist, its just bugging me. I hate DIVs now lol


i updated the page so you can take a look if you need to

also, wen you scale it height-wise, it seems to be messing up aswell.

Why are div's such a pain? :flowers:

This post has been edited by Sp0nge: 24 January 2008 - 05:43 PM


#4 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,604
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 24 January 2008 - 05:50 PM

It scrunches up because the div tag is getting resized to fit the window. Nothing you can do about that unless you are into scripting something that resizes the text. Chances are that nobody will be looking at it on anything less than 800X600 anyway.

If I recall correctly, the image dictates the size of the div, so no matter what, the div is always going to be as big as the image, and you will not be able to resize it by scaling the page.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#5 User is offline   Sp0nge 

  • Distinguished Member
  • PipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 643
  • Joined: 24-October 06
  • Gender:Male
  • Location:Sydney, Australia

Posted 24 January 2008 - 06:24 PM

Quote

Chances are that nobody will be looking at it on anything less than 800X600 anyway.


yeah you're probably right.

Thanks so much once again Groove.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users