Hi,
i'm new to php, but not html. For a forum i want to add a sidebar to the right of the forums content, so that the threads or forums content is left to the sidebar. The forum is fluid and in order for the fiexed right sidebar i need the left forum content to be fluid.
I think i tried it all, like inline, float:right and width:auto with out without css, but the only code that works is setting a percentage on the forum content div. Now the problem is if a user with a different resolution visits the forum, the sidebar moves to the top, above the forums content.
I'm sitting here for two weeks now can can't figuere it out.
Sry if my english doesn't make sense, i will try my best to explain it.
Can anyone please help?
Trying to keep one div fluid, whilst one is fixed
Moderator: General Moderators
Re: Trying to keep one div fluid, whilst one is fixed
Layout: 1-st column liquid, 2-nd fixed
HTML:
CSS:
Also check this: http://blog.html.it/layoutgala/
HTML:
Code: Select all
<div class="fixed">
Praesent consequat egestas rhoncus. Donec non massa eros.
</div>
<div class="liquid">
Sed metus turpis, vestibulum vel iaculis id, cursus eget velit. Ut vel tortor imperdiet odio dignissim tempus at sed metus.
</div>Code: Select all
.column-liquid {
padding-right: 400px; /* Make sure content is not below fixed column */
background: #f0f0f0;
}
.column-fixed {
float: right;
width: 400px; /* Since this column is fixed */
margin-left: -400px; /* Move it on top of content, which has padding-right */
background: #fff0f0;
}Re: Trying to keep one div fluid, whilst one is fixed
Thanks! I hope it will work, since i believe that some css code from the forum messes with my new settings.
And also thanks for the link, its VERY helpfull! I been checking the links in the sticky, but this one must have passed me.
For 3 weeks now fulltime i've been trying to understand what is going wrong and i honestly jsut want to get over with it.
And also thanks for the link, its VERY helpfull! I been checking the links in the sticky, but this one must have passed me.
For 3 weeks now fulltime i've been trying to understand what is going wrong and i honestly jsut want to get over with it.
Re: Trying to keep one div fluid, whilst one is fixed
Ok, i tried it out, but the fixed sidebar is on top left of the forumcontent.kaszu wrote:Layout: 1-st column liquid, 2-nd fixed
HTML:CSS:Code: Select all
<div class="fixed"> Praesent consequat egestas rhoncus. Donec non massa eros. </div> <div class="liquid"> Sed metus turpis, vestibulum vel iaculis id, cursus eget velit. Ut vel tortor imperdiet odio dignissim tempus at sed metus. </div>Also check this: http://blog.html.it/layoutgala/Code: Select all
.column-liquid { padding-right: 400px; /* Make sure content is not below fixed column */ background: #f0f0f0; } .column-fixed { float: right; width: 400px; /* Since this column is fixed */ margin-left: -400px; /* Move it on top of content, which has padding-right */ background: #fff0f0; }
I tried a layout from the link, and it almost worked, but the forums content wasn't fluid and instead of using 100% of the space between left side and sidebar on the right, it only used about 65%.
This is too complicated for me, it jsut doesn't make sense to me. I uderstand how divs work, but this not logical to me.
Any idea?
Re: Trying to keep one div fluid, whilst one is fixed
Ok now it gets even more confusing.
I tried some more and now everything is fine on the indexpage, but not in the threadview. In the threadview now the sidebar is on the right and the content div is below the sidebar although the margin for the sidebar is enough. Kinda like a rectangle with equal 4/4th where the top right quarter is the sidebar and the bottem left one is the contentent.
i don't understand why everything is ok on the indexpage but not in the threadview.
Please help. I will also pay money in order to get this finally done!
I tried some more and now everything is fine on the indexpage, but not in the threadview. In the threadview now the sidebar is on the right and the content div is below the sidebar although the margin for the sidebar is enough. Kinda like a rectangle with equal 4/4th where the top right quarter is the sidebar and the bottem left one is the contentent.
i don't understand why everything is ok on the indexpage but not in the threadview.
Please help. I will also pay money in order to get this finally done!
Re: Trying to keep one div fluid, whilst one is fixed
What's you HTML / CSS for columns?
Re: Trying to keep one div fluid, whilst one is fixed
i guess i found the problemmaker and with that another problem.
Since it works on the index, but not in the thread view i took firebug and had a look which class or id the thread-content DIV uses. Now i can't find that class or id and that is the new problem.
This i use for the css and it looks perfectly good on the index:
.fixed {
float: right;
width: 260px;
I also tried yours and any combination.
I downloaded the whole forum and searched it with notepad++, but in none of the files i could find the class or id.
I also tried the webdevelopment kit for Firefox, yet still i can't find the id.
Is there any way to find out in which css or php file a class or id is declared?
Since it works on the index, but not in the thread view i took firebug and had a look which class or id the thread-content DIV uses. Now i can't find that class or id and that is the new problem.
This i use for the css and it looks perfectly good on the index:
.fixed {
float: right;
width: 260px;
I also tried yours and any combination.
I downloaded the whole forum and searched it with notepad++, but in none of the files i could find the class or id.
I also tried the webdevelopment kit for Firefox, yet still i can't find the id.
Is there any way to find out in which css or php file a class or id is declared?