background-image: url(path-to-file/img.jpg); background-repeat:no-repeat; background-position: center center;
That should work.
If not, why not make a div
with the image and use z-index
to make it the background? This would be much easier to center than a background image on the body.
Other than that try:
background-position: 0 100px;/*use a pixel value that will center it*/
Or I think you can use 50% if you have set your body min-height
to 100%.
body{ background-repeat:no-repeat; background-position: center center; background-image:url(../images/images2.jpg); color:#FFF; font-family:Arial, Helvetica, sans-serif; min-height:100%; }
Related Posts:
- CSS reset – What exactly does it do?
- When to use margin vs padding in CSS [closed]
- SVG center horizontal and vertical line
- Can I change Bootstrap button color?
- Is it bad practice to comment out single lines of CSS with //?
- How to draw a half circle (border, outline only) [closed]
- CSS Circle with border
- Set parent style via child
- What is the proper way to display a logo with CSS?
- Responsive font size in CSS
- How to make a vertical line in HTML
- CSS Font Border?
- How do I change the background color with JavaScript?
- Why em instead of px?
- Vertical Align Center in Bootstrap
- Button Center CSS
- How to change the cursor into a hand when a user hovers over a list item?
- not:first-child selector
- CSS: center element within a element
- what is a parse error and how do I fix it
- Bootstrap NavBar with left, center or right aligned items
- How to make the overflow CSS property work with hidden as value
- How to make a sticky footer in react?
- How to push a footer to the bottom of page when content is short or missing?
- Linking to a pdf file with html
- Can I add background color only for padding?
- Change TD border color with HTML or CSS
- Why adding version number to CSS file path?
- Hide text using css
- Changing the width of Bootstrap popover
- CSS background color not working
- Bootstrap transparent navbar
- jQuery toggle CSS?
- 100% DIV width is not really 100%
- CSS 3 slide-in from left transition
- CSS selectors ul li a {…} vs ul > li > a {…}
- Bootstrap scrollable panel
- CSS checkbox input styling
- Is there a CSS selector for elements containing certain text?
- How to place two divs next to each other?
- Background color in input and text fields
- CSS3 opacity gradient?
- CSS3 background image transition
- How to import Google Web Font in CSS file?
- CSS Equivalent of the “if” statement
- How to make div background color transparent in CSS
- Fix footer to bottom of page
- CSS: Creating textured backgrounds
- Check if an element contains a class in JavaScript?
- Changing the width of Bootstrap popover
- Equivalent of jQuery .hide() to set visibility: hidden
- Remove scrollbar from iframe
- How to make circular background using css?
- Align
elements side by side- margin-bottom not working
- Why doesn’t min-height not work on my page?
- Custom CSS in WordPress messing up
- How to add stylesheets only to pages with specific shortcode?
- Modernizr and WordPress – How can I add a CSS class to the html element?
- WordPress Displaying Thumbnails Vertically
- To enqueue or not to enqueue
- How to get child style.css to load last rather than second behind parent style.css?
- Remove Genericons Helper CSS from twentyfourteen theme
- How to make Custom Walker for wp_nav_menu() for materialize framework
- Altering html structure and creating custom menus
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Can you edit WP gutenberg block css without a plugin?
- Style internal links based on the tags of the linked post
- How to override Bootstrap css with my child theme css in wordpress?
- How to stop Gutenberg from outputting inline CSS for specific blocks?
- “Scattered” gallery
- How to enable table overflow scroll? (especially order list table)
- Correct way to include extra styles & script files?
- Adding CSS to custom post type admin page causes error
- Inside a loop, how to change CSS class based on category name?
- Change CSS based on is_user_logged_in
- Plugin and themes are adding the same stylesheets
- Reduce white space in twenty fourteen
- How to know which order WordPress places CSS files?
- All of my custom Bootstrap styles are not working in my child theme!
- Place title (in correct place) above image with opaque background [closed]
- Overwriting forced wordpress CSS styles [closed]
- Show Secondary Sidebar on Category pages (archive)
- Styling an “active” link outside of WordPress default menu
- W3TotalCache and Javascript — what should go where, when?
- WordPress sidebar content moving to bottom of page
- custom template display 3 columns
- Blog page and the Home page showing the same content
- WP Admin Bar transparent on some pages (.screen-reader-shortcut)
- How to Compress Css/js code in wordpress and increase loading speed?
- @media applying globally and not separately for each screen width [closed]
- Are WP images responsive by default?
- WordPress site using unknown overriding css
- Active menu item / category
- Combining fancybox with multiple thumbnail plugin
- Display ajax preloader for large images within posts
- div having different appearances in different themes
- Stop underlining image links
- Enqueue MCE Editor CSS in admin page
- Help with Divi logo not appearing for 10s