main div not aligning to the top (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


ncriptide -> main div not aligning to the top (1/20/2008 19:16:24)

Could someone please take a look at the internal pages of this site and tell me why the main content div won't go up to the top. It seems to always stay below the left side div, no matter what I do. The problem is seen on Windows using IE 6 and 7. Looks okay on a Mac using Firefox.

http://www.catawbacounseling.com/docs/victoria.html

Any advice for a newbie css developer would be GREATLY appreciated.




matt_f -> RE: main div not aligning to the top (1/20/2008 20:54:04)

im not an expert on css but from the looks of the source code, you are using external scripts - post the external css code on here so people can see the alignment properties (mainly for <div id="content"> and im certain someone will be able to help

~Matt~




caz -> RE: main div not aligning to the top (1/20/2008 21:08:56)

Try this -
#content {
	background-color:#879197;
	color:#FFFFFF;
	/*width: 360px;*/
	margin: 0;
	padding:10px 5px 10px 260px;
	/*border:thick solid #FFFFFF;*/
	}


Removing the width from #content will allow the natural flow of the document and it will just fill the space available in the #contentwrapper.

You may want to adjust your padding on the right side though. It looked OK in Firefox on the pc, but as usual IE has a little trouble with sizing.




Tailslide -> RE: main div not aligning to the top (1/21/2008 2:16:21)

I generally find it easier to float stuff due to the IE messing about issue.

If the above doesn't work for you in FF and IE then try this:

#contentwrapper {
   width:630px;
   background-color: #879197;
   border: thick solid #FFFFFF;
   margin:0 0 0 75px;
   padding:0;
   overflow:hidden;
}
#content {
   float:right;
   background-color:#879197;
   color:#FFFFFF;
   width: 360px;
   padding:10px 5px 10px 0;
   }




d a v e -> RE: main div not aligning to the top (1/21/2008 2:40:00)

by the way - that's a nice looking site! but, it's uncomfortable having 2 pictures of you as the eye tries to focus in 2 places at the same time - i would suggest replacing the top next to the house with another image or keep it as text (i just realised that it's part of your navigation...)

oh and your copyright symbol doesn't display properly (http://www.w3schools.com/tags/ref_entities.asp for those sort of things)
you need
&[nospace]copy; (remove the [nospace] bit)

:)





ncriptide -> RE: main div not aligning to the top (1/21/2008 19:04:39)

That's it, CAZ!!!!

Thank you so much . . . I was banging my head against the wall about that for hours and all I had to do was NOT put in a width?!

This stuff is going to drive me mad . . . . but thanks Caz, and everyone that responded. I really appreciate all of your help. Hope I can do the same one day.

Reggie




ncriptide -> RE: main div not aligning to the top (1/21/2008 19:07:06)

Dave,

Thanks for catching that on the copyright symbol. . . didn't even notice it. . . thanks!

Reggie




caz -> RE: main div not aligning to the top (1/22/2008 5:10:45)

You are welcome Reggie, sometimes the simple approach is the best with CSS.
Carol




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.09375