Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2015-06-03 05:25:47

TigerAero
Member
From: WI, USA
Registered: 2009-02-01
Posts: 458
Website

CSS: Trying to get image to be full length of parent div.

If you look at the homepage in the signature I'm talking about the June-banner.jpg file. I've tried many things from stackoverflow and nothing there has worked yet.

Am I just thinking about this all the wrong way? Keep in mind, however, that it's a php generated file (a php date() function) and so it gets generated after the CSS...so maybe I'll have to do it inline? IDK.

Last edited by TigerAero (2015-06-03 05:26:41)

Offline

#2 2015-06-03 07:49:54

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,639
Website

Re: CSS: Trying to get image to be full length of parent div.

You can give it an absolute width, but that's likely not what you want... Should it scale or be cropped? For the latter, object-fit is your friend (but only supported in modern browsers).


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#3 2015-06-03 16:09:45

TigerAero
Member
From: WI, USA
Registered: 2009-02-01
Posts: 458
Website

Re: CSS: Trying to get image to be full length of parent div.

Franz wrote:

You can give it an absolute width, but that's likely not what you want... Should it scale or be cropped? For the latter, object-fit is your friend (but only supported in modern browsers).

I'd like the image on the right to take up the remainder "right side" of the screen. Both images are in their own div while also inside a parent div. So I guess scale?

Offline

#4 2015-06-03 16:26:41

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 1,292
Website

Re: CSS: Trying to get image to be full length of parent div.

Can you post what CSS you're using at the moment (and the relevant HTML) ?

I can find the HTML in the source code, but there are several bits of CSS.

Offline

#5 2015-06-03 16:57:15

TigerAero
Member
From: WI, USA
Registered: 2009-02-01
Posts: 458
Website

Re: CSS: Trying to get image to be full length of parent div.

chris98 wrote:

Can you post what CSS you're using at the moment (and the relevant HTML) ?

I can find the HTML in the source code, but there are several bits of CSS.

Other then the div holding the image, "display: inline-block; height: 130px" there's no other css atm.

Offline

#6 2015-06-03 16:58:11

chris98
Member
From: England, United Kingdom
Registered: 2013-05-31
Posts: 1,292
Website

Re: CSS: Trying to get image to be full length of parent div.

Try adding float: right

Offline

#7 2015-06-03 17:01:50

TigerAero
Member
From: WI, USA
Registered: 2009-02-01
Posts: 458
Website

Re: CSS: Trying to get image to be full length of parent div.

chris98 wrote:

Try adding float: right

I want that right image to scale to the far right of the page and take up all the extra whitespace on that line.

Offline

Board footer

Powered by FluxBB