This is a discussion on "positioning with CSS" within the Web Page Design section. This forum, and the thread "positioning with CSS are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
positioning with CSS
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
positioning with CSS
Hi Guys
I am just starting my first web site for my dads artwork. i'm working on the Home Page and I want to do it in the correct manner by using CSS for layout. So far I have a banner, a navbar and a flash element underneath. The banner and navbar are centre aligned by using the text-align:center in the <body>tag in the CSS file. The problem is I want to position the flash element directly underneath the navbar but I can't seem to get it in sync. I have used the position:absolute rule. It looks like it's centred but then changes position when I maximise the window of the browser. Could anybody offer any advice on the positioning for me? Link to the file is below. Thanks, Craig http://uk.geocities.com/johnson463@btinternet.com/ |
|
|
|
|||
|
Re: positioning with CSS
try adding
margin : 0 auto; to any element you want to center. absolute positioning is never a good way to go. |
|
|||
|
Re: positioning with CSS
Hey Craig, since this is your first design, I'm going to show you how I'd do it.
Here's your new css
Last edited by Lchad; Apr 22nd, 2007 at 13:14. Reason: hit submit too quickly |
|
|||
|
Re: positioning with CSS
Thanks LChad. That seems to do the trick but in Internet Explorer the whole page is aligned left. In Firefox & Netscape the page seems to be centred as desired. Any ideas?
Also, this isn't anything majorly wrong but in the division that holds the flash animation do you know why there is a bit of the beigey background color showing under the flash part? |
|
|||
|
Re: positioning with CSS
Add to your css
html { margin: 0; padding: 0; } That might also take care of the extra spacing near the flash. I can't actually test that because I don't have your flash. If that doesn't work play with adding overflow: hidden; to the maincontent div. (or is it overflow: visible;?) try both |
|
|||
|
Re: positioning with CSS
I added that rule to the css and the overflow bit but the page is still aligned left in Internet Explorer. And still has the space under the flash too!
http://uk.geocities.com/johnson463@btinternet.com/ Last edited by Craigj1303; Apr 22nd, 2007 at 20:11. |
|
||||
|
Re: positioning with CSS
What version of Internet Explorer?
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
|||
|
Re: positioning with CSS
Version 7, on windows XP
Quote:
I got rid of that flash div hours ago and the middlecontainer was already coded as you suggested from earlier. As for the Script, that seems to be something that is added to my HTML by my service provider when I upload. It's really annoying Also, neither deleting the flash div or making the middlecontainer: height 255px got rid of the extra space below the flash animation Last edited by Craigj1303; Apr 22nd, 2007 at 22:50. Reason: added comments from LChad |
|
||||
|
Re: positioning with CSS
The problem with embedding flash is you have to use some javascript to bypass IE's active X sillyness. bleh.
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
![]() |
| Tags |
| css |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CSS and positioning | djme | Web Page Design | 6 | Feb 3rd, 2006 13:27 |
| Positioning with CSS | Tino | Web Page Design | 8 | Jan 21st, 2006 15:45 |
| css positioning | ivyholly | Web Page Design | 14 | Dec 20th, 2005 18:43 |
| Positioning with css | Hub | Web Page Design | 12 | Dec 13th, 2005 19:45 |
| div positioning | benbacardi | Web Page Design | 10 | May 24th, 2004 12:25 |