My target is that a spider is going down it's web in the background.
I need the web image (a simple vertical line) to tile above the spider, while the spider image sits at the bottom.
You can't have two background images on the same element.
Simply, create a div right inside your body that takes full width and height. Then use the tiled background in one of them (the div, I assume) an the fixed background in the other (the body, I assume).
Watch out for margins and padding across browsers, though!
WebKit (Safari, Chrome) does allow multiple backgrounds; just seperate them with commas.
maybe you put "the spider" as fixed background image for your <body> tag and put "the web" as a background image (with repeat) for a div set to { width: 100%; }
Related
I have a container that contains 2 divs a transparent background color that sits on top of the video tag, the video should be full screen width 100% (height does not matter)
For some reason the transparent div is overlapping the video container height slightly (on the bottom) as seen here:
http://jsfiddle.net/v3vLq0nv/
This does not happen for an image tag, note for this example I have used an embedded youtube iframe as it has the same problem as the tag.
If I set a height on the parent container then it works fine, but setting a fixed height for the parent container makes the video not full width anymore.
The only thing I found that does work is actually change the HTML5 declaration from:
<!DOCTYPE html>
to
<!DOCTYPE>
Which I guess means it's HTML5 anymore which is not a great solution.
Note doing this in jsfiddle will not make it work as jsfiddle itself will put the declaration back in the frame "!DOCTYPE html"
I think the best two options here are:
#videoContainer { height:150px; }
or
#videoContainer iframe { float:left; }
They will both solve your problem.
Add display:block; to iframe :)
Is there a way to make an image repeat beyond the element div that it is placed in? When the browser is maximized, the picture will stop where the footer stops but I'd like to repeat to the max height of the browser. Possible without putting the image in the body bg? I can't place it in the body bg because of a jquery animation, and IE gradient code and an image can't be put together. Thanks.
-edit- found the solution
background image vertical repeat for a div
set the html and body in css with height:100%;
and also height:100%; in the div with image
worked because the div with the image was the first div before the reset of the content div
You cannot have images repeat outside of the parent div size in such a way that is still cross-browser compatible as far as I know.
Alright, I am designing a website using XHTML 1.0 Strict and CSS 1,2,3. And, I have a container for the page, that contains every div within the container, I have min-height specified on the container to ensure expanding of the page.
But, I have another container within the page container that contains a content div and sidebar div and all 3 of the containers inside the content container are set to height: inherit; and all have a min-height.
On the container which includes both the content and sidebar divs, I have a background gradient image which is positioned at the top and center, but am also calling out a background color which I want to continue as a sort-of fade-out effect, which would leave the container open for page expansion.
But, the problem is, the color is not repeating all the way down within the container.
You may view the design below, it is linked with a pretty well organized External Style Sheet. As well as the HTML page being well organized.
http://www.noxinnovations.com/portfolio/kolja/
Thank you very much StackOverflow,
I hope to hear from someone very soon,
Aaron Brewer
I'm not 100% sure if i understood your problem.
But adding:
this
float: left;
to this:
#content-container
Should do the trick.
That link gave me a 404 Page not found.
Perhaps you mean that you want to stretch the background-image using css? In that case I can tell you that such a thing is impossible. You cannot stretch css background images.
Usually when you want a gradient background you make a sufficiently long gradient and fill the rest of the background with the ending color of the gradient.
CSS 3 supports defining gradients as colors. W3C working draft of gradients.
If i have a body using a background image and a div inside the body using a set background and color, how can I override the div's style to use the body's background image? I don't want to simply set the background of the div to the image as positioning of the image will be off.
I don't want to simply set the background of the div to the image as positioning of the image will be off.
You mean you want the body's actual background image to be visible (not just the URL being inherited) even though the div has a background color defined? That is not possible.
You would have to give the div a background-color: transparent to make the body's background image shine through.
The W3's background-image documentation specifies that inherit is an invalid declaration for the property.
It seems redundant to post the same information as #Pekka, but his work-around is, probably, the best non-inherit option available; although Eric Meyer's 'Complex Spiral' demo is also an option, which combines position: absolute; with multiple different versions of, essentially, the same background-image to achieve quite an impressive 'tinted/coloured' effect.
I want to build a fixed width website which is 960px wide and aligned to the left. However, I want to use a background which is wider than 960px and that fills the space to the right if the user has a screen wider than 960px.
This is easy using a background image:
body {background:url(myreallywidebgimage.png) 0 0 no-repeat}
#wrapper {width:960px;}
But can I do it where the background is an SVG, without a horizontal scroll bar appearing?
The only thing I can think of that would turn off the horizontal scrollbar is to do something like as follows:
#wrapper {width:960px; overflow-x:hidden}
Edit: Upon further reflection I decided it was best to see if Google offered up an other possible suggestions and I came across this: http://helephant.com/2009/08/svg-images-as-css-backgrounds/. The above solution will only work if you assign the background to that div element. You can, however try assigning overflow-x:hidden to the body itself to see if that solves the problem as well. Hopefully these suggestions help.
The background will scroll only if your SVG image has pixel dimensions which exceeds that of the browser window. If you set the image to have 100% width and 100% height, the background should not scroll.
Take a look at this web site. They're essentially doing what you want. They have an SVG gradient as the background. As you resize the browser, the gradient adjusts to fill the entire window.
http://emacsformacosx.com/
They also have a lot of other SVG on the page, but the background gradient is all you need.