February 4, 200917 yr I've got the html and the css files open. in the css i've got: @charset "utf-8"; body { background-attachment: fixed; background-image: url(Images/gradient-380x1050.jpg); background-repeat: repeat-x; background-position: left top; } div { background-image: url(Images/Maincontent-practice.jpg); background-repeat: no-repeat; background-position: center; position: absolute; } So the background I want is showing up, but the second part (the div) isn't showing up at all. If I put anything else in it like specify the font, nothing happens either... So it is linked but now what. ARGH Also what is that bit at the top (@charset "utf-8" Thanks
February 4, 200917 yr what does your html file look like? and http://www.w3.org/International/questions/qa-css-charset It's just a character set declaration.
February 4, 200917 yr try position: relative; for your div rather than position: absolute; currently its content will decide the height, if you have no text, or the text is not as high as your background image, you'll have to specify a height (and a width) for the div.
March 1, 200917 yr Hmmm, have you tried linking your HTML file correctly to your CSS files using the following head section "<head> </head>". HTML Head Example <link rel="stylesheet" href="name_of_your_css_file.css" type="text/css" /> CSS Example body { background-attachment: fixed; background-image: url(Images/gradient-380x1050.jpg); background-repeat: repeat-x; background-position: left top; } #div { background-image: url(Images/Maincontent-practice.jpg); background-repeat: no-repeat; background-position: center; position: absolute; } Once thats done then make sure you have given your div's the right discription - 'class' (e.g- .text_style) or 'id' (e.g - #header_div). Hope this helps
March 1, 200917 yr Hi, In your CSS you say the following. div { background-image: url(Images/Maincontent-practice.jpg); background-repeat: no-repeat; background-position: center; position: absolute; } Is the DIV your trying to style called 'div'? If so you should be doing the following: #div { background-image: url(Images/Maincontent-practice.jpg); background-repeat: no-repeat; background-position: center; position: absolute; } Notice the '#' sign.
March 13, 200917 yr All of this still depends on the HTML as bocaj has already spotted. it's all well and good having the correct CSS, but it still won't show if the HTML is wrong. Show us the HTML you're trying to use with it and we'll be able to tell you exactly where things are going wrong.
Create an account or sign in to comment