Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Css-two columns-driving me crazy

Status
Not open for further replies.

qtluvsjc

Technical User
Apr 27, 2007
18
US
I'm not sure what happened, but it's driving me crazy.. i want two columns.. the first 240px, the second 480px.

I want a picture centered in the 480px second column. It is hanging way to the right.

my 'draft' site is at
My CSS for 'main'=(text on right), and 'sidebar'=(picture on left) is:

#main {
float:left;
width:240px;
text-align:justify;
}

#sidebar {
float:left;
width:480px;
}



2nd question:

My navigation links are as follows:

:: Ministries :: Services :: Calendar :: Youth Group :: Adult Swamp Mennonite :: Ministerial Staff :: Contact & Location ::


How do I add at least a second space in between the links? they look like they are too close together..

Instead of :: Ministries ::

I would like it to be :: Ministries :: ... etc

Thanks!
 
well it looks like you have an img embedded in span which is embedded in an h3. i bet if you removed the <h3> and <span> (which probably have padding that is shoving your image to the right), you'd probably get your results.

as for the spacing on your nav par -- personally i'd do it differently but in the short term, add padding to...

Code:
.style2 a
{
padding: 3px;
}
 
In line 87 of your CSS you're negating your float: left; width: 480px for the #sidebar with the float: right; width: 240px. Since whatever comes lower in the css stylesheet prevails, it is that that decides where the #sidebar is placed. If you remove that second declaration, you will be ok.

As for the menu, as much as I don't like it, you would insert [tt][ignore]&nbsp;[/ignore][/tt] instead of spaces. HTML is white space agnostic, meaning that any number of normal spaces or new lines are treated as one space. What I suggested is an html entity for non-breaking space.

Alternatively, you would play with the padding on the links, which might be more desirable in terms of clean code.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Thanks Ethorn, I did you you said, and it stopped it from flying off my page. But my picture is still not centered in between the two columns.

Is there not a way to do this in WYSIWYG?
 
i prefer not to use WYSIWYG and i think you'll find most others in here don't like them either. however, you should give vragabond's advice a try. his was "more correct" than mine.
 
ethorn: there is nothing wrong with your suggestion.

I would however make a special a rule for the menu items, or you would have padding-issues if there where inline- anchors...

Olav Alexander Mjelde
Admin & Webmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top