ElkArte Community

Title: Poster background
Post by: CrimeS on May 21, 2015, 11:00:01 am
I was looking at some themes and what came to my attention was that no one, separated the poster background from the actual message background. I don't mean just the background for the info, but split each message to left and right, so that the poster's background has height of 100% (it's not full when the message is longer).

Adding a class .poster and setting its background kind of works, the height isn't stretched. Anyone has a quick solution to that? :D
Title: Re: Poster background
Post by: emanuele on May 21, 2015, 11:48:24 am
I'm tempted to say:
Code: [Select]
.poster {
    float: none;
}
.postarea {
    display: table-cell;
}
It looks like the whole template was already prepared for that, but for some reason it was not used... not sure why though.
Title: Re: Poster background
Post by: Jorin on May 21, 2015, 04:19:47 pm
Oh, that's great! Must try this with a light grey in my theme! Thanks for finding this one!
Title: Re: Poster background
Post by: ahrasis on May 22, 2015, 12:08:51 am
I do remember, I made this SPB mod (Smart Post Bit) (http://www.elkarte.net/community/index.php?topic=2102.0) which changes that area a bit. I like it the same background color with the post but may be changing that will be better.
Title: Re: Poster background
Post by: emanuele on May 22, 2015, 02:29:59 am
I remembered there was something, but I couldn't remember the name...
Title: Re: Poster background
Post by: Jorin on May 22, 2015, 02:59:50 am
Is it possible to extract the poster backgound from the post background so that they are both a frame? I made a screenshot...
Title: Re: Poster background
Post by: ahrasis on May 22, 2015, 04:42:39 am
Quote from: CrimeS – I was looking at some themes and what came to my attention was that no one, separated the poster background from the actual message background. I don't mean just the background for the info, but split each message to left and right, so that the poster's background has height of 100% (it's not full when the message is longer).

Adding a class .poster and setting its background kind of works, the height isn't stretched. Anyone has a quick solution to that? :D
Ok. I nailed it down to this:
Code: [Select]
div.windowbg, div.windowbg2 {
overflow: auto;
padding: 10px 0;
}
The full height can be achieved by changing 10px to 0. You may need to add that back in .poster and .postarea instead to achieve the same padding for both.
Title: Re: Poster background
Post by: Spuds on May 22, 2015, 08:26:14 am
@Jorin You can get pretty close to that by adding a left border to the postarea div

So in custom.css add
Code: [Select]
.postarea {
border-left: 4px solid #ccc;
}
div.windowbg, div.windowbg2 {
padding: 0 0;
}

Probably want to be more selective on the windowbg padding as that will change it everywhere, but as an experiment I think that would get you something like what you posted.
Title: Re: Poster background
Post by: CrimeS on May 23, 2015, 04:56:52 am
Quote from: ahrasis – Ok. I nailed it down to this:
Code: [Select]
div.windowbg, div.windowbg2 {
overflow: auto;
padding: 10px 0;
}
The full height can be achieved by changing 10px to 0. You may need to add that back in .poster and .postarea instead to achieve the same padding for both.

So, what in overall needs to be done to achieve that? I'm not getting the desired result (eh, I should take bigger breaks).
Title: Re: Poster background
Post by: ahrasis on May 23, 2015, 08:09:34 am
You have to combine it with what emanuele has shown in reply#1.[1] That is all you need to do.
Doing only that suggestion will leave 10px padding on top and bottom.
Title: Re: Poster background
Post by: CrimeS on May 23, 2015, 08:18:38 am
Ah I see. It works perfectly! Thank you very much.  I hope that other people will find this useful as well.
Title: Re: Poster background
Post by: Jorin on May 27, 2015, 01:31:38 am
Great! I wanted to use a background image with a very light grey variation of our logo, so I tried this and it works great.

Edit: No, it doesn't.  :o  See screenshot please. My css code is this:

Code: [Select]
.poster {
    float: none;
background-image: url(../../images/theme/bg_poster.png);
}
.postarea {
display: table-cell;
}
div.windowbg, div.windowbg2 {
overflow: auto;
padding: 10px 0;
}

Oh, and when an image larger then forum width is posted with img bcc inside a post, the area floats to the right and leaves the screen. The text inside the post cannot be read anymore because it is beyound the screen.  :D

Funny, but not for a productive board.  :-\
Title: Re: Poster background
Post by: TE on May 27, 2015, 04:20:20 am
please try
Code: [Select]
.postarea {
display: table-cell;
width: 100%;
}
Title: Re: Poster background
Post by: Jorin on May 27, 2015, 04:32:53 am
Almost... I tried:

Code: [Select]
.poster {
    float: none;
background-image: url(../../images/theme/bg_poster.png);
background-repeat: no-repeat;
}
.postarea {
display: table-cell;
width: 100%;
}
div.windowbg, div.windowbg2 {
overflow: auto;
padding: 10px 0;
}

...because I don't want the background to be repeated.
Title: Re: Poster background
Post by: Spuds on May 27, 2015, 03:35:40 pm
You may have to resort to setting some widths to make those "table cells" behave .. try just this for an experiment.
Code: [Select]
.poster {
    float: none;
background: url(../../images/theme/bg_poster.png) no-repeat;
min-width: 15em;
}
.postarea {
display: table-cell;
width: 100%;
}
.post_wrapper  {
width: 100%;
}
div.post_wrapper {
padding: 0;
}
Title: Re: Poster background
Post by: Jorin on May 28, 2015, 12:56:56 am
Thanks, but that's no solution.  :(
Title: Re: Poster background
Post by: Spuds on May 28, 2015, 08:00:23 am
Well worth a try, hope someone comes up with one.

ETA: I just put that in a custom.css on the default and it seemed to do what you wanted, so no idea whats going on.