Ethodax Ethodax - 1 year ago 114
CSS Question

CSS Image Resizing for subreddit theme

I am currently trying to use a subreddit theme and resize an image to be bigger/actual size of uploaded image.

Current code for the Logo is:

#header .pagename a {
width: 100px;
background: url(%%subredditlogo%%) left center/auto 50px

I am trying to scale image to be bigger with keeping aspect ratio.

Like I said this is on Reddit, so I can only interact with the subreddit stylesheet.

I have edited it some and played with it, I have gotten improvements, but not the full image to show.

Here is my current code:

#header .pagename a {
width: 300px;
background: url(%%subredditlogo%%) left center/auto 300px;
background-size:100% 200%;

It has resized the width but I cant get the height to change. I have tired the:

left center/auto 300px;

but nothing, and also the

height: 100%;
height: auto;

Just looking to get it fixed now.

Answer Source

Try this:

background-image: url(%%subredditlogo%%);
background-position: left center;

I believe you need to break out your "background" css into individual attributes in order for each attribute to work properly.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download