Fix background image within div

Hello
I've done a lot of research about this, and tons os answers have come up, still, none solved my problem so far.
I'm trying to make the background image within a div to be fixed when i scroll vertically.
Have a template made, in which the only editable div is the rightdiv. (in red, to be easier)
Here's my code
CSS
body {
margin-top: 0px;
margin-bottom: 0px;
background-position: center center;
background-image: url(../Images/bgdr.jpg);
background-repeat: no-repeat;
#wrapper {
height: 875px;
width: 1000px;
margin-right: auto;
margin-left: auto;
background-repeat: no-repeat;
#header {
background-repeat: no-repeat;
clear: none;
float: none;
height: 214px;
width: 1000px;
background-image: none;
position: relative;
padding-top: 10px;
#leftDiv {
clear: none;
float: left;
height: 500px;
width: 245px;
position: relative;
text-decoration: none;
#rightDiv {
clear: none;
float: right;
height: 484px;
width: 755px;
position: relative;
overflow: auto;
#footer {
height: 100px;
width: 1000px;
clear: both;
position: relative;
padding-bottom: 20px;
And here is my HTML
<!-- InstanceBeginEditable name="RightDiv" -->
  <div id="rightDiv" style="background-image: url(Images/informacao.png)">
  </div>
  <!-- InstanceEndEditable -->
Well, thing is that on Internet Explorer 9, the background image will repeat vertically when i scroll vertically. On Chrome it will stay fixed on scroll (and that is what i want).
I tried adding style="background-attachment:fixed" , but that will make the image align fix itself relatively to the whole page, not the div only. Also, it repeats itself 4 times to oocupy the screen. I can solve that by "no-repeat", but it still is fixed to the browser page, not the div.
I've been trying to fix this for days.. Help would be much appreciated.
Funny thing is that this only happens in IE9.. Chrome works perfectly.

DevilUrd wrote:
Didn't work. sorry, but i don't think i understood ur reply quite well..
Here's what i used:
<!-- InstanceBeginEditable name="RightDiv" -->
<div id="rightDiv" background:  url('Images/informacao.png') no repeat fixed;>
<tr>
        <td>textextextextextextextextext</td>
      </tr>
<!-- InstanceEndEditable -->
Could u pls be a little more detailed?
sorry, but i'm still very unexperienced at this..
That is not a valid way to write css into your page and will not work. You appear to be trying to use the background shorthand css property within the html tag itself. If you want to use an inline style, it would need to be within the style html attribute...
<div id="rightDiv" style="background:url(Images/informacao.png") no-repeat fixed top left;">
But it would be better to place it in your css instead...
#rightDiv {
clear: none;
background:url(Images/informacao.png") no-repeat fixed top left;
float: right;
height: 484px;
width: 755px;
position: relative;
overflow: auto;

Similar Messages

  • New bug in IE11 -- scrolling position:fixed + background-image elements jitters badly.

    visit the following page in IE10 and IE11, and use your mouse wheel to scroll the page:
    http://www.oussamaharb.com/
    In IE <= 10, Safari, Chrome, and FireFox, the header section of that page stays put when scrolling.  However, only in IE11, when you scroll the page the the header jumps around and jitters.  Essentially IE11 will do this on any div with a fixed
    background image.
    Note the jitter does not happen if you grab the scrollbar with the cursor and move it up and down (which people rarely do).  Some sort of bug when using mouse wheel has been introduced in IE11.

    You are too late to see.  He removed
    background-attachment:fixed with IE11.  His link originally showed the stuttering.  It looked too unsatisfactory.
    You can still see his handsome design with FireFox where it continues to work well.  (And also good with Chrome, Opera, Safari too).  See how the picture on top stays fixed when you scroll the page?  Not with IE anymore.  With IE
    that great effect is removed, sacrificed to cure the ugly wart.  The picture now just scrolls upward with the page to avoid the IE11 bug.  Too bad.
    Since your first reply here 7 months ago.  Have you any special MVP insider-info yet how to make this great CSS3 port-hole feature scroll smoothly with IE11?  Or possibly, you have encouraging news that it will become corrected in IE12?  Your
    name is IECustomizer MVP.  It sounds like you will know.
    Here are more stutter examples for you to examine.  You may click the background to toggle several different ways to see the affliction during scroll.  Please post back and tell your observation that you can see this stutter.
    https://googledrive.com/host/0B8BLd2qPPV7XOGl1Sjk3c29uVlU
    Possibly somebody still hasn't yet noticed in bryanangler's example ("OP"), IE11 needs to be maximized (or large) to observe the problem.  At least,
    somebody has not acknowledged.  Bryanangler's page is Responsive Web Design (RWD).  The menu on top is present when space permits.  That's when the
    background-attachment:fixed applies and makes the horrid stutter.

  • Fixed Background Image

    How can I get a fixed background image in my iWeb? The kind where it stays put and the text scrolls.

    Can anyone help with this please?

  • div drop shadow hidden behind background image of div below

    I am trying to show the <div navigation> drop shadow on top of the <div mainImage> background image. How can I fix the css to show it on top of the bar picture? Here is the site in progress... http://cishenanigans.com/index2012.html
    Thanks!

    You should use z-index. But this works only on absolute or relative positioned elements.
    In your case, replace this:
    #mainImage {
    margin: 0px;
    padding: 0px;
    height: 300px;
    width: 1020px;
    background-repeat: no-repeat;
    background-position: center center;
    background-image: url(../images/mainImage.jpg);
    to this:
    #mainImage {
    margin: 0px;
    padding: 0px;
    height: 300px;
    width: 1020px;
    background-repeat: no-repeat;
    background-position: center center;
    background-image: url(../images/mainImage.jpg);
    position: relative;
    z-index: -10;
    That should do the trick

  • Fixed background image not wanted

    Hi all,
    I am having a problem that has me stumped. I have a background image applied to a div and even though I haven't specified anywhere in the css for this image to be fixed position, it will not scroll with the rest of the text. I have tried to apply background-attachment css of scroll etc, but nothing is changing.
    Here is the page in question - http://www.sheffieldstudent.co.uk/test/studentstrology_may2011.html
    CSS is here: http://www.sheffieldstudent.co.uk/test/_css/student.css
    Any ideas? Thanks.
    PS: Sorry for the slow DL speed but I haven't compressed the images yet.

    As for the text resize layout problem, I see what you mean. I don't know any other ways of accomplishing the same design without using background images for the navigation. Would there be a better way?
    Sure - each text block would need to be in its own container, each with its own background image.  That way, when the block expands vertically, the text doesn't overlap other background images.  Your background images would have to be designed to allow this vertical expansion, however, which could be tricky or impossible depending on the complexity of the image.

  • Background image fill div, text with padding

    I have a div set up with a width of 182px, and the padding is T:15 R:10 B:15 L:20. The text in the div works with these parameters, but when I add my background image (a bar of color) also 182px, it does not fill the div, only about 75% of it. I'm learning as I go, so any advice would be appreciated.

    gregjb wrote:
    I have a div set up with a width of 182px, and the padding is T:15 R:10 B:15 L:20. The text in the div works with these parameters, but when I add my background image (a bar of color) also 182px, it does not fill the div, only about 75% of it. I'm learning as I go, so any advice would be appreciated.
    Padding is added to the dimensions of the <div>. So your <div> is really 182px wide plus padding left and right 30px = 212px
    So your background image needs to also be 212px wide.
    HOWEVER if you do want your <div> to only be 182px wide set its width to 152px wide to take into account the padding.

  • Embedding background image within a svg map

    Hi
    Iam using mapviewer to generate and store maps. The maps also have aerial photographs attached as a background image. currently the image is a link and the actual image is stored on the mapviewer server. I want to be able to embed the image within a svg map. so that the map can be stored and rendered independent of the mapviewer server. can you suggest a way of doing this using mapviewer (other than downloading the image to the requesting client machine after every request).
    Thanks
    Chandra Srinivasan

    Currently the background image is always rendered as a seperate file and attached to the SVG map using a hyper link. There is no way to store the map image inside the svg file. There is a reason for this- it is very unefficent to encode and store a large image files using BASE64, which is the only way to embed a binary image into the SVG file.

  • How to make a fixed background image in Dreamweaver CC

    I'm trying to make my background image fixed so when I scroll down in Dreamweaver CC it stays completely still, could someone please tell me how to do that?

    You've got a lot of code that you don't need.  And I'm very dubious about the file:/// path to your image.  Are you working in a Defined Local Site Folder?  The image path should be pointing to your site, not files:/// on your local hard drive.
    body {
    background:#000 url(concept_watch_dogs___wallpaper_1366x768_by_mackintosh141-d6led76.jpg) no-repeat center center fixed;
    Nancy O.

  • Images within div doesn't show up in browser

    Hi,
    I am creating a website for a local band (Oh, Nostalgia) and I was having an issue of images disappearing in my browser (I have checked the website in both IE and Chrome.)
    Basically the website design is a simple header followed by a navigational bar. The header lies in a div as the background to the div. I am trying to insert the navbar image inside of the div so that it is superimposed over the current background. This way I can create a functional navigational bar on top of the header image. (Please note that the navbar image I am using is placed using an <img> tag, rather than placed as a background.)
    When I do this in the Dreamweaver (CS4) design "stage," it appears exactly how I want it. However, when I preview in IE/Chrome, I get a transparent frame with a small "X" box in the corner of where the image needs to be.
    My HTML
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Oh, Nostalgia</title>
    <link href="css/index.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="starburst">
    <center>
    <img src="/images/navbar.png" width="1024" height="407"/>
    </center>
    </div>
    </body>
    </html>
    My CSS
    @charset "utf-8";
    body {
         background-image: url(../images/wood-texture.png);
         background-repeat: repeat;
    #starburst {
         background: url(../images/starburst.png) no-repeat center top;
         width: 100%;
         height: 100%
    #shelves {
         background: url(../images/shelves.png) no-repeat center top;
         width: 100%;
         height:auto
    #navbar {
         background: url(../images/starburst.png) no-repeat center top;
         width: 100%;
         height: 407px;
         z-index:10;
    My Original Design Mockup
    What I get in IE
    I hope I've made it clear as to what I would like to do, and what my problems are at this point. I would greatly appreciate it if you could help me figure this out. If you believe that there is a different way around creating this "navbar," I would gladly redo this website to those specifications.
    Thanks in advance,
    Kaveet

    Update: I just found a way to make it work. It must have been a small problem with Dreamweaver.
    Thanks anyways for responding!

  • Can Edge Reflow handle type on top of background image within a box?

    What I mean is, from code point of view, it's not <img src="">, but <style="background: url()">, then put type on top of the background image.  Can Edge Reflow handle that?  Really appreciate your help.

    This forum is actually about the Cloud, not about using individual programs
    Once your program downloads and installs with no errors, you need the program forum
    If you start at the Forums Index http://forums.adobe.com/index.jspa
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says ALL FORUMS) to open the drop down list and scroll
    http://forums.adobe.com/community/edge_reflow_preview

  • Using a fixed background image

    I am just getting started with Muse, and am trying to duplicate a site that I'm building in Dreamweaver. My site has a stationary background that stays fixed as I scroll the page down or up. Is there a way to do this with Muse?*

    Hi Jerry,
    Welcome to the world of Muse!  I am very much an amateur, still learning Muse and never used another program, so I hope this is what you are actually looking for...
    It depends...  if you use the image as a browser fill, make sure that you uncheck the scroll box at the bottom of the fill options.  If you are placing the image directly onto the page, then just pin it - select the image, go to the pin option to the left of the x-y-w-h- coordinate settings on the control panel, and click on one of the dots.
    Hope this helps....
    Kate

  • CSS Background Image - where is it?

    Hello, Have placed a fixed background image within my
    CSS...it looks fine when I look at it in Dreamweaver. The problem
    is when I upload to my webspace the image isn't there. Any ideas?
    These are the attributes:
    background-attachment: fixed;
    background-image: url(images/home.gif);
    background-repeat: no-repeat;
    background-position: 1px;

    dulcettones" <[email protected]> wrote in
    message
    news:f3m22g$kpu$[email protected]..> Sorry...the
    URL is:
    > www.notjustthenews.co.uk
    > The image in question goes in the top left corner and
    changes depending on
    > the section you're viewing.
    Remove: background-attachment: fixed; and you'll see the
    image shows up on
    the index page. You need to remove that on each of the rules
    you have set
    for the #top divs... some of them are missing the white
    background color
    also.
    Nadia
    Adobe® Community Expert : Dreamweaver
    CSS Templates |Tutorials |SEO Articles
    http://www.DreamweaverResources.com
    ~ Customisation Service Available ~
    http://www.csstemplates.com.au
    Spry Widget Examples
    http://www.dreamweaverresources.com/spry-widgets/

  • Background image in a div?

    I know how to use css to place a background image inside a
    div. However, I would like that image to be contextual, and be
    differrent depending what the current page is. As an hypothetical
    example, I would like a non-repeating background image of an apple
    inside <div class="content"> when the page apples.html is
    open, but then an image of a banana would be the background image
    inside <div class="content"> for bananas.html.
    If there is a way to place background images on the fly,
    directly in the html, that would be the better solution for this
    novice.
    Thanks for any help!
    r

    Do it this way -
    <style type="text/css">
    div.content { background-repeat:no-repeat; }
    #apples div.content {
    background-image:url(/images/apple.jpg); }
    #banana div.content {
    background-image:url(/images/banana.jpg); }
    </style>
    (put this in the head of each page (or put the rules into a
    site-wide
    external stylesheet)
    Now, on the apples page, change this -
    <body>
    to this -
    <body id="apples">
    and on the bananas page, change it to this -
    <body id="bananas">
    Get it?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Sbisa" <[email protected]> wrote in message
    news:ffqvhs$5q6$[email protected]..
    > Thank you!
    >
    > I will give it a try. I am googling for tutorials on
    this, but if anyone
    > has one in their pocket that they could share, much
    appreciated.
    >
    > r

  • Resizing 1) background images and 2) div's containing images

    I just created a web page consisting of little more than an image (about 900 pixels) wide which is set at width=100% in a style sheet. It works great, but I'd like to substitute a smaller image (to reduce page loading time) in mobile devices.
    If it was a background image, I could just declare two different background images based on screen size, but I don't know of any way to swap between images actually inserted in a page.
    So, is it possible to give a background image a width in percentage, similar to a static image? In other words, if my screen was 651 pixels wide, then a static image inside a container spanning the entire screen should also be 651 pixels wide. Can I rig it so that a background image in that container would also be 651 pixels wide?
    Of course, the obvious problem is height. If a background image measures 900 X 1200 pixels, and a screen is 600 pixels wide, then even if there's a style that makes the image 600 pixels wide, it would also have to calculate a height of 800 pixels, and I'm guessing that can't be done.
    Anyway, I'd just like to know what kinds of tricks one can use in making background images and divs containing static images display in percentages based on screen size.
    Thanks.

    Use background-size:cover; for your background images.
    Further reading: http://css-tricks.com/perfect-full-page-background-image/
    EDIT:// For swapping out placed images, it's a little harder to do right now as there is no specified solution from W3C. Some people want to use the srcset attribute, others the <picture> tag. There is no perfect approach right now. See: http://mobile.smashingmagazine.com/2013/08/21/webkit-implements-srcset-and-why-its-a-good- thing/
    One idea is you could hide the image and then load a background-image in the container which is smaller in size. But this would likely bloat your HTML and CSS as you use multiple images - the device will also load both images so you don't gain any real advantage unless you intend to show a croppoed or different image.
    Other ideas: http://mobile.smashingmagazine.com/2013/07/08/choosing-a-responsive-image-solution/
    <div class="image">
         <img src="YourImage.jpg" alt="" width="500" height="250" />
    </div>
    @media only screen and (max-width: 480px) {
         .image img {display:none;}
         .image {
              background:url("YourImage_Mobile.jpg") no-repeat 0 0;
              background-size:cover;
    Another idea is to show/hide the relevant image:
    <img src="YourImage.jpg" alt="" width="500" height="250" class="desktop" />
    <img src="YourImage_mobile.jpg" alt="" width="300" height="180" class="mobile" />
    @media only screen and (max-width: 480px) {
         .desktop {display:none;}
         .mobile {display:block;}

  • Stopping tiling in a table background image

    I'm trying to stop the tiling of the background image within
    a table in Dreamweaver 8.
    It seems to be different then "no-repeat" for the general
    background.
    Was hoping someone could help me out.
    Thanks.

    You have no tiling control there at all.
    Change this -
    <table width="612" height="1081" border="0"
    background="ess_web_ad_bg.jpg">
    to this -
    <table width="612" height="1081" border="0"
    background="ess_web_ad_bg.jpg"
    style="background-repeat:no-repeat;">
    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
    ==================
    "Ro-Dogg" <[email protected]> wrote in
    message
    news:[email protected]...
    > THANKS!
    >
    >
    >
    >
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN"
    > "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    > <html xmlns="
    http://www.w3.org/1999/xhtml">
    > <head>
    > <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    > <title>Untitled Document</title>
    > <style type="text/css">
    > <!--
    > .style1 {
    > font-size: 12px;
    > font-weight: bold;
    > }
    > .style2 {font-size: 12px}
    > .style4 {font-size: 18px; font-weight: bold; }
    > -->
    > </style>
    > </head>
    >
    > <body>
    > <table width="612" height="1081" border="0"
    > background="ess_web_ad_bg.jpg">
    > <tr>
    > <td width="21" height="143"> </td>
    > <td width="557"> </td>
    > <td width="20"> </td>
    > </tr>
    > <tr>
    > <td height="294"> </td>
    > <td rowspan="3" valign="top"> <div
    class="style4"><span
    > styleclass="style_HeadlineText">Are Your Employees a
    Road
    > Block?</span></div>
    > <div class="style2"><span
    >
    styleclass="style_HeadlineText"> </span></div>
    > <span class="style2"
    styleclass="style_HeadlineText">
    Did You Know
    > That</span>
    > <ul class="style2">
    >
    10%-12% of all applicants have a criminal history
    > </li>
    >
    43% of resumes contain significant inaccuracies about
    > experience, education or job ability </li>
    >
    8.5% of applicants who authorized background checks had
    > criminal convictions</li>
    >
    > <div class="style2">
    > <div>
    The potential costs and liabilities of
    unscreened or
    >
    insufficiently screened employees are enormous. Employers
    can be
    > held
    > legally and financially responsible for things they
    should have known
    > about
    > their employees.</div>
    > </div>
    >
    > <li class="style2">
    Employers lose 79% of all negligent hiring and
    > retention lawsuits </li>
    > <li class="style2">
    Two-thirds of negligent hiring trials result
    > in
    > average awards of $600,000 in damages </li>
    > <li class="style2">
    30% of all business failures are caused by
    > employee theft </li>
    > <li class="style2">
    The Small Business Administration estimates
    > that
    > for every dollar invested in employee screening a $5 to
    $16 return is
    > generated</li>
    >
    > <p align="center" class="style1"><span
    > styleclass="style_SubheadingText">FOLEY SERVICES INC.
    PROVIDES
    > COMPREHENSIVE
    > EMPLOYEE SCREENING SERVICES TO BUSINESSES OF ALL
    SIZES</span></p>
    > <div class="style2">
    > <div>
    We can conduct specific individualized background checks
    > in
    > all of the areas listed below, or provide screening
    service packages
    > tailored
    > to your needs. </div>
    > </div>
    > <li class="style2">
    Criminal Records Checks: Patriot Act
    > Inquiry,
    > Sex Offender Registry, Federal and Non-Federal criminal
    history checks
    >
    > </li>
    > <li class="style2">
    Background and Reference Checks:
    > Verification of
    > Employment, Education, Reference, Social Security
    Numbers, and
    > Professional
    > credentials </li>
    > <li class="style2">
    Motor Vehicle Reports </li>
    > <li class="style2">
    Financial/Healthcare Sanction
    > Checks</li>
    >
    > <span styleclass="style_SubheadingText">
    > <p align="left" class="style2">Foley Services has
    a 15-year track
    > record
    > of servicing our client's with professionalism, courtesy
    and respect.
    > Let
    > Foley Services put our expertise and experience to work
    for you by
    > helping
    > you hire the right people for the job.</p>
    > </span>
    > <div align="center"> </div>
    > <div align="center">
    Click on the link below for further detailed
    > information.<br />
    >
    <a href="
    http://www.foleyservices.com/t-ebc_facts.aspx">FOLEY
    > SERVICES EMPLOYMENT SCREENING
    SERVICE</a></div>
    > <div align="center"> </div> <div
    align="center">
    or
    > Contact:<br />
    >
    Kirk Spooner<br />
    > National Accounts Representative<br />
    >
    1-800-253-5506 x469
    <br />
    > <a
    >
    href="mailto:[email protected]">[email protected]</a></div></td>
    > <td> </td>
    > </tr>
    > <tr>
    > <td height="204"> </td>
    > <td> </td>
    > </tr>
    > <tr>
    > <td> </td>
    > <td> </td>
    > </tr>
    > <tr>
    > <td height="191"> </td>
    > <td> </td>
    > <td> </td>
    > </tr>
    > </table>
    > </body>
    > </html>
    >
    >

Maybe you are looking for

  • Submit RIMODGEN in Background

    Does anyone know how to submit RIMODGEN in the background?  Here's a small clip of my code.  I don't think the problem is with my parameters.  The program executes but the integration model is not created.     CLEAR gt_params.     PERFORM load_params

  • 2011 MacBook Pro Runs slow and Freezes

    I have a Macbook Pro 2.8 GHz Intel Core i7 running 8 GB of RAM and it runs like a dog - freezing and crashing like a PC would - have to keep rebooting it. What is going on. Has Bill Gates poisoned the Apple?

  • All .swf audio plays on slide 1 when published as swf file!

    Help! I am trying to publish a series of projects (seven) as swf files to upload to moodle for a CBT course.  This is my first time ever using Captivate in this way and when I go to view the outputs using a web browser, all of the audio for the imbed

  • Duplicate Workitem in Inbox

    Hi Gurus, I have created new Z event for Service notification (ZCHANGE) which will trigger on the change of service notification. I have configured this using TCODE SWEC. While configuring this I have selected option 'On Change'. For creation of Serv

  • BGM: Master Warranty sort field

    Hi all, I have search all over the place in order to know the function of the "Sort Field" in the Master Warranty. If I do have several counters, it stated that I can set priorities of my warranty counters by using free defined sort field. But how do