How to get background image to fill the browser and remain fixed in both IE and Firefox?

Basically what it says in the title. I've come very close in achieving this but something just doesn't tie up in the html and css code...
First of all, I'm using IE8 and the latest version of Firefox to test this.
I used 2 sources of information for getting this done: 1) http://css-tricks.com/perfect-full-page-background-image/ and 2) http://stackoverflow.com/questions/8958697/css3-background-size-cover-doesnt-make-image-co ver-vertically
In Case 1 the example on the page called CSS-Only Technique #1 gives code that works almost perfectly for me, except that obviously I need a background image, however the CSS provided there is clearly just for an image dropped in the body of a page with no regard for other content that may already be there. The html code that I put on the page is simply <img class="bg" src="../images/background_image.jpg">
Obviously I used the CSS code provided in the example, minus the last bit which is "@media screen" etc etc, which seems irrelevant to me. Obviously substituting values to suit the image on my page.
So what happened is that it almost worked as intended in both the browsers (which means the image filled both browsers width-wise as intended and also remained fixed when I zoomed in or out in each case) except that the image went over the top of the current content that I had there already precisely because it's not a background in this "technique". (A curious side-note is that the image didn't push down the content, as I'd have expected in normal circumstances, but went right over the top of it so it hid it (like z-index).
One thing that does bother me about this "technique" is that if you click on View Demo just below the code provided you will see on the working example page (forest background) the image clearly works as a background and the content sits happily on top! So I don't know whether the person providing the example was trying to mislead people or what! Or he got lazy and showed a different page that didn't use the exact code he provided. No matter.
In any case this leaves me with the job only half finished, as I still need a background image that works like the 'normal image' code provided.
On to Case 2 and on this page the first example provided gives the CSS for the background image - namely the code within html {...} part and also shows the same 'normal image' code as given in Case 1. In this case however, although the person provided a suggestion, the css and html doesn't really tie up properly plus some of the css and html seems a bit redundant. So this time when I used the 'html portion' of the CSS code (i.e. just the bit that was most relevant) I got two different behaviours in each browser and neither of which was quite what I'm looking for. In IE8 initially the page looks fine (background fills the page and content is on top) however when I zoom in or out the background also zooms in or out accordingly so is NOT fixed. In Firefox the background image DOES stay fixed, however because the image originally is not the whole height of the browser I'm guessing the code stretches it downwards (while keeping proportions - so the image essentially enlarges) to fill all of it. The quick way to get around it is to probably add some white space to the bottom of the image just to give it enough height that it doesn't stretch/resize automatically. But it would be nice to find out anyway how to get around this in the code. Overall I would say that the result in Firefox comes closest to the desired solution but of course it doesn't help matters with IE8.
Apologies for the lengthy description but that should at least provide plenty info for anybody that might have a possible solution for me. Essentially what would be great is if somebody could advise me how to take the code from Case 1 and apply it to a 'background' piece of coding like the type that's contained within html {...} in Case 2. Like I said, it's so nearly there but I just can't make it work atm after trying to combine the various bits of code this way and that... Alternatively, if somebody has another html-css version that works nicely for achieving this then please by all means let me know! Thanks v much in advance!

This works in modern CSS3 supporting browsers.  But not pre-IE9.
http://alt-web.com/TEST/Resizable-BG.shtml
Nancy O.

Similar Messages

  • Just 1 Background image to fill the browser & NOT tiled images

    After reading some of the suggestions given in this forum, I gather that I have to use CSS to get around this problem. What I did was:
    in a Notepad text editor, typed & saved as mystyle.css
    body
    background-image:url('gradient-3-max.jpg');
    background-repeat:no-repeat;
    (*note: fr the CSS tutorial > How to > external style sheet. I may not have understood it completely.
    Reads: ...... Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section:)
    <head>
    <link rel="stylesheet" type="text/css" href="mystyle" />
    </head>
    I added this tag in my HTML document, however, the background is still tiled.
    Where did I go wrong? I am a newbie to flash, so kindly guide me thru each step
    Thank you!
    Karen

    This works in modern CSS3 supporting browsers.  But not pre-IE9.
    http://alt-web.com/TEST/Resizable-BG.shtml
    Nancy O.

  • How to set a background image to fill the entire screen on any device in a spark mobile application

    Hi,
    I started developing a mobile application with Flex.
    I'm trying to set a background image to fill the whole screen. I've been stucked at this point for days now. I tried everything and no solution seems to work for me.
    I'm using a TabbedViewNavigatorApplication and i need to set some background images on views.
    I need my image to fill the entire screen on any device. i don't need to mantain image aspect ratio,  just need it to be fullscreen. This seemed to work when setting a custom skin on the TabbedViewNavigatorApplication, however this blocked all my views for some reason and all components contained in view became invisible.
    Can you please tell me how can i achieve this?
    Kind regards,
    Dan

    Basically you need a larger image which can accommodate any device. The trick is to show only what each device can display, so therefore some clipping will occur based on device. Have something centered and towards margins have a  gradient or just plane colors that way the stuff in the middle will be visible on every device while nobody will care if you are clipping from the color fill.
    C

  • How do I fit a background image to fill the entire page?

    Hi,
    could anyone please tell me how I use e.g. a jpeg image as a background image that fits the entire page without getting horizontal or vertical scroll bars?
    Thanks

    Hi Pziecina and Nancy O.,
    thank you so much for your mails. However, I'm still trying to figure this out.
    @ Pziecina...I studied the source code of your webpage and tried to insert parts of it into my own page in different variations. The solution to my problem must have something to do with CSS and img src height and width. All I get is a white page. I found out that an image size set in Photoshop apparently doesn't have any effect on whether the image fills the browser 100% or not.
    @ Nancy O. What I'm trying to do is to use one single image as background for a single page on the website, I'd like to construct. An image that opens up to the entire width of the screen...not just the browser. I imagine this with layers of transparent/solid color for text fields. I studied the website page, you suggested and a repeat action is not what I aim for. And I realize that maybe I'm thinking too much in Photoshop terms...thinking I can do similar actions in Dreamweaver.  I'm well aware of the whole thing being 'too much' in terms of design and usability but if you check out www.frauhaus.dk I think that works beautifully, although it doesn't open up to the entire screen. I'd like to see if that design concept will work for my own website or if it's going to be too confusing.
    And to both of you I really appreciate your time and input, thanks. Even though I'm still getting grey hairs as a beginner I keep thinking that there's got to be a solution to this.
    Best regards from MissRaspberryDream

  • How do i get my image to fill the whole page in pages

    I am making an epub book and would like the image on my cover page to fill the whol page without the large white borders around it. How can I do that in pages. I know you can't export a document as an epub if it has floating objects in it but i don;t know if thats a problem for this application or not. Thanks

    Menu > File > Page Setup > create a custom paper size of 9" x 13.5" > set all margins to 0 > Format > Any Printer > OK
    Create your custom cover as a jpeg and crop to 9" x 13.5" or proportional pixel equivalent.
    Import your cover onto the first page of your ebook.
    Inspector > Wrap > Object Placement > Inline...
    Stretch cover image to fill the page.
    Menu > File > Export > ePub > Use first page as book cover image
    Haven't tried this myself, but this is what is recommended.
    Peter

  • Background image to fill the whole screen

    Hi everybody
    Please assist,
    1st question : I want to add the background image that fit the whole screen. I have tried to put image background however it leaves white spaces on the edges and another thing is that after adding the background image when I add content in the tables the background image start to repeat.
    This is the website example I want to achieve : www.inesjaksic.com , www.grupa-desperado.com
    www.street-heroes.com
    2nd question : How to add the scroll bar on the text content, so when you scroll only the text moves.
    Website example : http://www.kls.com/page.php?p=about/biography/index
    Thank you in advance for your help.
    Kind regards
    Vusi
     

    #1 Background images are static.  They don't resize to fill the browser viewport without a lot of additional tricks which may or may not work in all browsers.   Moreover images that resize quickly become distorted.   For best all around results, build your page to a fixed-width target audience (990px is usually fine for most users).  Use a seamless background tile or gradient slice and repeat it vertically (repeat-y), horizontally (repeat-x) or both ways (repeat).
    #2 Use CSS overflow and height property.
    #divName {
    height: 400px;
    overflow: scroll;
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • How to get background image in cell not to repeat help please.

    hi folks,
    i want to fill a cell with a background image and not have
    the image repeat if the cell is resized by a viewer by enlarging
    the text. (Previously i jsut used CSS to control the text, so it
    couldn't be rezied, but now it seems that firefox ignores the CSS).
    ANyway i would like people not to be able to resize the cell and
    the background not to repeat.
    Here is an example that when the text is resized the
    background image and cell saty the same but a scroll bar appears
    for the text.
    http://www.stephenhuyler.com/projects.cfm
    thanks for any help!

    Use CSS -
    td.special { background-repeat:no-repeat; }
    for this cell -
    <td class="special"....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "intolight" <[email protected]> wrote in
    message
    news:enh08e$8u9$[email protected]..
    > hi folks,
    >
    > i want to fill a cell with a background image and not
    have the image
    > repeat if
    > the cell is resized by a viewer by enlarging the text.
    (Previously i jsut
    > used
    > CSS to control the text, so it couldn't be rezied, but
    now it seems that
    > firefox ignores the CSS). ANyway i would like people not
    to be able to
    > resize
    > the cell and the background not to repeat.
    >
    > Here is an example that when the text is resized the
    background image and
    > cell
    > saty the same but a scroll bar appears for the text.
    >
    http://www.stephenhuyler.com/projects.cfm
    >
    > thanks for any help!
    >

  • How many pixels can images have that the browser can show them?

    hi
    i'm creating large images which i save as gif. now i have seen that there is a limit for gif images which defines that gif images can not be larger than 64kx64k pixels. thats ok, but both internet explorer and mozilla can not open gif images larger than i suppose 30000x200 pixels. could that be right that there is a limitation in the web browsers?

    If so, it would be completely dependent on the browswer in question.... either way, you don't want to be sending an image that big I don't think. if I was at a site that had a pic that big, i would never go back, just my $.02

  • Need background photo to fill the space

    Dreamweaver CS3 / Mac 10.5.8
    I am working with a combination of tables and CSS. In one cell of my table, I am trying to get a background image to fill the space. It is filling only about 1/4th of the space. This is the code I have:
    <td height="742" align="center" valign="top" background="images/Hands1.jpg" style="background-repeat: no-repeat;">
    Can anyone tell me what code I can add to enlarge the image to fill the entire space?

    Cohek wrote:
    Dreamweaver CS3 / Mac 10.5.8
    I am working with a combination of tables and CSS. In one cell of my table, I am trying to get a background image to fill the space. It is filling only about 1/4th of the space. This is the code I have:
    <td height="742" align="center" valign="top" background="images/Hands1.jpg" style="background-repeat: no-repeat;">
    Can anyone tell me what code I can add to enlarge the image to fill the entire space?
    You can't enlarge a background image.  Background images are static.
    Make a bigger image in your graphics app, or repeat your background-image with CSS (see link below for details):
    http://w3schools.com/css/css_background.asp.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • How to display "Image" object in the browser?

    can anyone please tell me how can i display "Image" object in the browser?
    I have an image object that i retrieved from AS400 BLOB object by using toolbox.jar (for as400 access for java including all necessary classes like jdbc driver, security etc.).
    i want to display this object in the browser so i will be able to web-enable my BLOB objects stored on as400.thx...

    In your HTML:
    <img src="ImageServlet">
    In ImageServlet:
    Make calls to DB to get your image as byte array and store it in:
    byte[] buffer = new byte[imageSize];
    ServletOutputStream out = response.getOutputStream();
    for(int i = 0; i < imageSize; i++)
    out.write(buffer, i, 1);
    out.close();

  • Hi I have opened my trial of photoshop,but cant figure out how to get an image from my pictures in t

    I have opened my trial of photoshop,but cant figure out how to get an image in.

    Hi,
    The first video on https://helpx.adobe.com/creative-cloud/learn/start/photoshop.html shows you one way to do this: If you open Photoshop, just drag the image file from Explorer/Finder into the PS workspace (or even just to the PS icon).
    Another way is to open Photoshop, select File > Open from the menu, and navigate to your image.
    Hope this helps,
    Randy Nielsen
    Learning Content Manager, Creative Cloud Learn
    Adobe

  • How to get my images always order by file name, and not by time of captur, in all the folders in the library?

    How to get my images always order by arquive name, and not by time of captur, in all the folders in the library?
    Sorry for the poor english, but im portugues.
    In the library we can change the order of classification of image by, time of capture, name of file etc... I'm wondering if its possible define to be always by the name of file.
    It ´s possible?
    And i have other question, in print label we have an option to auto rotate to feet in page to have the image using the maximum area in the page (auto rotate, zoom etc), its possible to change the orientation of the rotation to be always in  the other direction?

    The Muvos are USB Mass Storage devices and do not have the ability to display track information based upon ID3 tags.
    The Zens all read and display track info based upon ID3 tag information that is either gathered from an online source or entered by the end-user.
    If you want the track information displayed instead of the ID3 tag information, you could edit the ID3 tags and rename the title to whatever you have as the file name. Not sure why your file names would differ so much from the ID3 tag info though, almost all of my content has the same name for the filename as it does on the ID3 tag title.

  • How to repeat a background image to cover the height of the page?

    Hi
    I have a page with an image alinged to the top in a table and
    I have a pattern in the background of the cell in the same table
    I need that background of the cell to repeat it self along
    the height of the page, so when someone views the page at a higher
    resolution, the background image will repeat it self to cover the
    extra space.
    I've tried setting the height of the table to percentage, but
    the table doesn't cover the height of the page.
    I could also make the table really long so when viewed at
    higher resolution there wont be any blank space at the bottom, but
    this makes an unnecessary and long scroll when viewed at lower
    resolution.
    Someone told me to use css but i have now idea how to
    implement that.

    make sure you have set your page margins to 0 if you don't
    want the default
    margin top left. Cut and paste the following into the head of
    your document
    just before the closing </head> tag.
    then if you want to repeat a background image in a cell, you
    need to create
    a rule to do this:
    .cellback {
    /*this repeats the image across the page horizontally*/
    /* if you want to repeat down the page, then change to
    repeat-y */
    background: url(pics/whatever.gif) repeat-x;
    you can combine this background image rule with the other
    margin setting so
    you have:
    <style type="text/css">
    <!--
    body {
    margin: 0;
    padding:0;
    .cellback {
    background: url(pics/whatever.gif) repeat-x;
    -->
    </style>
    You then apply to the class to your cell
    <td clas="cellback">
    Examples here:
    http://www.dreamweaverresources.com/tutorials/pagebackgrounds/cellbackground.htm
    this shows how to use a background image for your entire
    page:
    http://www.dreamweaverresources.com/tutorials/pagebackgrounds/examplehor.htm
    Nadia
    Adobe� Community Expert : Dreamweaver
    http://www.csstemplates.com.au
    - CSS Templates | Free Templates
    http://www.perrelink.com.au
    - Web Dev
    http://www.DreamweaverResources.com
    - Dropdown Menu Templates|Tutorials
    http://www.adobe.com/devnet/dreamweaver/css.html
    > I have a page with an image alinged to the top in a
    table and I have a
    > pattern
    > in the background of the cell in the same table
    > I need that background of the cell to repeat it self
    along the height of
    > the
    > page, so when someone views the page at a higher
    resolution, the
    > background
    > image will repeat it self to cover the extra space.

  • HOW TO UPLOAD BACKGROUND IMAGES IN SMARTFORMS

    HI
    HOW TO UPLOAD BACKGROUND IMAGES IN SMARTFORMS

    Hi, 
       goto se78 -> in the menubar click graphic  and import to select ur images from ur system .. then click transport button .. it automatically gets into the smartform graphic image list.. then get into transaction smartform and use the image u imported into that..
    U can import anykind  of image which u have stored in ur pc through se78..
    Regards,
    Priya.

  • How to change background image in existing template?

    Hi 
    Current website needs overall change in background image which is already set in template. Is there anyone who knows how to change background image in existing templates?

    Make a friend with firebug &  you could find yourself from where it is getting applied.
    For the website you have given the background image it is using is [1] and it is getting set in css of body tag [2]. So Find the css at [3] and modify it OR replace [1] with other image with same file name.
    [1]   www.hanwha.com/etc/designs/hanwha/images/bg-body.jpg
    [2]
    body {
        background: url("images/bg-body.jpg") repeat-x scroll 50% 0 #FFFFFF;
        color: #757373;
        font: 14px/18px Arial,Verdana,Helvetica,sans-serif;
        margin: 0;
        min-width: 979px;
    [3]
    /etc/designs/hanwha/...../*.css

Maybe you are looking for

  • Getting error of CALL FUNCTION in coding

    hi all, i have wrtie a code for calling SMART FORM.In the coding START OF SELECTION,i got error at f_display_report This the code: FORM f_display_report .   DATA: fname(30) TYPE c.   CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'     EXPORTING       formna

  • Flex + cairngorm problem with 2 webservice

    hi i want to retrive data from 2 webservices using cairngorm.  flex can get data from the firsone and from the second is telling that doesn't see method, for me it is cos service it trying to find method from second webservice in this firstone. so wh

  • How many nodes can I run?

    Ok, in the (hopefully temporary) abscence of 4-processor G5 support from Apple, I can node my other half of the G5 Quad to itself, but can I also add my Pb 1.25Ghz as a node at the same time? If so, any ideas how?

  • Switch OK, now can't play!

    On Friday I used migration assistant to move all files from old iMac G-5 to new iMac. When I try to play the songs I get an alert that I am not authorized to play them on this (new) computer. I type in the ID and my new password, the same ones I used

  • I accidentaly reset my iphone 4s, how can I restore my pictures and contacts?

    i accidentaly resent my Ophone 4s so i wonder how can I get all my contacs and photos back?