Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Ap Div Alignment


  • Please log in to reply
4 replies to this topic

#1 Sp0nge

Sp0nge

  • Members
  • 643 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Sydney, Australia
  • Local time:05:01 PM

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

Edited by Sp0nge, 24 January 2008 - 04:07 PM.


BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:04:01 PM

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.

#3 Sp0nge

Sp0nge
  • Topic Starter

  • Members
  • 643 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Sydney, Australia
  • Local time:05:01 PM

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:

Edited by Sp0nge, 24 January 2008 - 05:43 PM.


#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:04:01 PM

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.

#5 Sp0nge

Sp0nge
  • Topic Starter

  • Members
  • 643 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Sydney, Australia
  • Local time:05:01 PM

Posted 24 January 2008 - 06:24 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users