The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Centering content in a fixed background image so it all loads centered.

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #165981

    Working on ab ebay site template that uses inline css and I think I found one I like. I have been tweaking it and its really coming along nicely but I came into a glitch.

    I decided I did not want the gray background image to take over the entire screen and thus allow for some white space. Once I turned the width of the background image to less than 100% the content started acting haywire. Positioning itself to the left without regard to the fact its background was reduced.

    Essentially I want both the main content and the reduced background image to be centered on the page but not necessarily the text attributes I would like them unchanged.

    Here is the link to the site I am working on:

    MOD EDIT: Code dump removed.


    Please don’t just dump a shipload of code on use.

    Try and create a demo in Codepen so we can get a better handle on it.


    Paulie I am new to this forum, your tone is quite hostile.

    There is a great way to reduce content from your view, you can minimize window, or walk away from screen if it causes you to much distress.


    Sorry you feel that way but a code dump really isn’t very helpful in diagnosing your issue.

    See that grey box over on the right headed “Tips”…that should help you out.

    Also this:

    Chris Coyier

    @jmarc4312 which background image are you trying to make smaller?

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.