This is a discussion on "Need help on keeping everything centered but with a min size" within the Web Page Design section. This forum, and the thread "Need help on keeping everything centered but with a min size are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Need help on keeping everything centered but with a min size
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Need help on keeping everything centered but with a min size
I am having a little trouble with my website. If you pull and adjust the size of this page (the webforumz page) the center section stays a fixed width, is centered on the page and is always a minimum distance away from the edges. How do you do that? What do I need to adjust in my code? My site is www.stevesdealpage.com and it has 5 sections on each page. Here is a copy of the head for the sections of my site
Last edited by karinne; Oct 1st, 2007 at 12:18. Reason: Please use the vBcode tags when inserting code in your post. |
|
|
|
#2
|
||||
|
||||
|
Re: Need help on keeping everything centered but with a min size
You need to create a wrapper/container div that all your content goes in.
jack
__________________
Jack Franklin - Webforumz Moderator (x)HTML | CSS | PHP | MySQL | JQuery (Javascript) Contact: My Blog | Twitter | Delicious Want Lessons? PM me. If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
|
|
#3
|
|||
|
|||
|
Re: Need help on keeping everything centered but with a min size
Quote:
I don't think that that will solve the problem. He is using a lot of {position: absolute} in all of the element. I tried to do the same solution but nothing happen to the content position. ziplock122949, whats up with the {position: absolute} things? Can you not use that to position your div elements? The css code that jackfranklin gave you can only be used if you throw away the {position: absolute} set it to default value and use the wrapper to position your site in the center of the screen. The key properties in centering your site is the (margin: 0 auto}
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
#4
|
||||
|
||||
|
Re: Need help on keeping everything centered but with a min size
Yes, that is what I mean't when I said 'this requires a bit of re-work with your code'. You need to get rid of the position: absolute for this to work.
__________________
Jack Franklin - Webforumz Moderator (x)HTML | CSS | PHP | MySQL | JQuery (Javascript) Contact: My Blog | Twitter | Delicious Want Lessons? PM me. If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
|
|
#5
|
|||
|
|||
|
Re: Need help on keeping everything centered but with a min size
yeah, misunderstood!
It's up to ziplock to do the trick...
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Last edited by Monie; Oct 2nd, 2007 at 01:50. |
|
#6
|
|||
|
|||
|
Re: Need help on keeping everything centered but with a min size
ok, got me half way to my goal. I deleted the position lines, added the wrapper header code and started the wrapper and ended it just inside the <body> and </body>. The page stays centered but all of the div sections from before are vertically one right after another.
i just started editing one of my temp files so if something bad happened it wouldnt matter too much here is the link http://www.stevesdealpage.com/storetemp.php I tried deleting the left and top also but it didnt work. thanks for the help too. I only know a little html but making programs for engineering classes helps me figure out what the heck everything is trying to do. (I have no clue what the programming languages are that we learned, it was using matlab mostly.) Having a idea of what is going on is helping since the website uses some open code here and there while allowing me to do some deeper editing than most beginners can do. Last edited by ziplock122949; Oct 2nd, 2007 at 08:46. |
|
#7
|
|||
|
|||
|
Re: Need help on keeping everything centered but with a min size
Your link did not work!
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
#8
|
||||
|
||||
|
Re: Need help on keeping everything centered but with a min size
On my screen the site is in the center so well done
Jack
__________________
Jack Franklin - Webforumz Moderator (x)HTML | CSS | PHP | MySQL | JQuery (Javascript) Contact: My Blog | Twitter | Delicious Want Lessons? PM me. If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
|
|
#9
|
||||
|
||||
|
Re: Need help on keeping everything centered but with a min size
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#10
|
|||
|
|||
|
Re: Need help on keeping everything centered but with a min size
Anyone know how to finish this up? Having a little difficulty moving the sections to where I want them.
the body looks like this
|
|
#11
|
|||
|
|||
|
Re: Need help on keeping everything centered but with a min size
Ok, it work now..
Quote:
Vertically? Horizontally...?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Last edited by Monie; Oct 3rd, 2007 at 08:01. |
|
#12
|
|||
|
|||
|
Re: Need help on keeping everything centered but with a min size
so it is in the same layout as my other pages right now (www.stevesdealpage.com) Im trying to get the current look inside the wrapper but its not working (www.stevesdealpage.com/storetemp.php)
|
|
#13
|
||||
|
||||
|
Re: Need help on keeping everything centered but with a min size
Try applying 'float:left;' to the DIV's that are appearing wrong.
|
|
#14
|
||||
|
||||
|
Re: Need help on keeping everything centered but with a min size
Ziplock, why not filp this baby around, and change the main site to be like the store (i.e. centered) I think it looks a lot better when it's in the middle of the screen (personal opinion)
__________________
WelshStew If you think I've helped, click the "Thanks" tierney rides tboard - uk site | xtreme wales - extreme clothing WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
|
|
#15
|
|||
|
|||
|
Re: Need help on keeping everything centered but with a min size
Thats what I am trying to do but its not working so well. I want the current layout to be the same but just inside the wrapper which is centered. As you can see by the test page it doesnt keep the layout it just puts one div section after another vertically so everything is out of place.
|
|
#16
|
|||
|
|||
|
Re: Need help on keeping everything centered but with a min size
Can you post your css again?
|