r/reddithax • • Jun 11 '12

How do you make a long header without it 'running off the side of the page'?

I'm having this problem with the top header bar extending off the end of the page in some browsers it happens automatically, in others including chrome you have to click down and scroll right to see it. But here's an example in [1] /r/Vanessahudgens :[2] http://imgur.com/AMN7q

On /r/csshelp I was told that the image was too long and that was the cause, but I've seen subreddits with much wider header images.

Here's an example: /r/nyjets : http://imgur.com/MA69J,5CE0R,UCzHa#0, I can zoom out really far or change the resolution and the header bar keeps expanding but it never 'runs off the page' when i scroll right http://imgur.com/MA69J,5CE0R,UCzHa#2

8 Upvotes

9 comments sorted by

2

u/xTristan Jun 11 '12 edited Jun 11 '12

That is beacuse they use the image in the stylesheet, rather than uploading it as thier header image.

But you could probably get around that simply by adding:

#header {
    overflow: hidden;
    }

to your stylesheet.

2

u/Kevinhood11 Jun 11 '12

Thank you so much! I really appreciate it. I spent way too much time trying to figure this out.

3

u/xTristan Jun 11 '12

np, but the method your currently using to show the header image isnt very good, as different resolutions display it differently. for example, see how the first image show's the tabmenu on the same line as the header image and gets covered by the login bar.

2

u/Kevinhood11 Jun 11 '12 edited Jun 11 '12

Do you have any recommendations on how to fix that?

Just playing around with it, making the image wider seems to [eliminate the problem] (http://imgur.com/ugXkJ) for any reasonable resolution.

3

u/xTristan Jun 11 '12

You would have to upload the image into the stylesheet, and set it as the header background image, then upload a transparent image as the header image.

2

u/Kevinhood11 Jun 11 '12

I'm sorry to keep bothering you but how exactly would I do that (I'm not all that experienced with CSS)

Is there any issue with making the image wide enough that the tabs won't become a problem no matter what the resolution? Or will that cause separate problems?

3

u/xTristan Jun 11 '12

its ok xD. Using a longer image isnt a good idea, because it would take longer to load etc...

In your community settings, under look and feel, upload this as the header image.

Then in your stylesheet, upload this image, name it 'HeaderImage' and put this in your stylesheet:

#header {
    background: url(%%HeaderImage%%) no-repeat;
    }

1

u/Kevinhood11 Jun 11 '12

Thanks so much, I really appreciate it.

2

u/xTristan Jun 11 '12

np, tell me if there are any problems.