I'm trying to learn CSS and I would like to know what I'm doing wrong on the following, I can't see the the gradient background at all. I'm including the file on the index.html. I can see the logo but, nothing after that. What's wrong?
Unless you specified a width on #container, width: 100% on #header means nothing. You do not need to declare display: block on natively block level elements (e.g. div, h#, p, etc). Why would you have a header that is display: inline containing block level elements? This makes no sense.
Now, on to your question - the path to the background file needs to be relative to your css file directory, not to your HTML file. That's a common mistake that people make, could that be your problem? I think you might need to put something in your div's, like rather than leave them empty.
Last edited by aj_nsc; 08-19-2010 at 11:36 AM.
I've switched careers...
I'm NO LONGER a scientist,
but now a web developer...
awesome.
Can you see any styling of your #headgradient div? If you put a border on it, can you see the border? What about the default background color?
EDIT: Wait wait....if this is most like CSS background gradients, you probably made a 1px wide image and plan on tiling it horizontally......is that the case? If it is, the no-repeat rule might be tripping you up.
I've switched careers...
I'm NO LONGER a scientist,
but now a web developer...
awesome.
The image is actually 100x100. After putting a border I noticed the image is actually under the logo when viewed using Chrome. Now, when using IE is right next to the logo. What's wrong in Chrome??
add clear: left; to #headgradient to get it to drop in IE - stupid IE.
If you're image is 100px x 100px then adding background-position: 363px 0; makes no sense. That would offset the background image in the div 363px to the right, at which point, with a no-repeat rule, there would be no image.
I've read that. That's where I'm getting help from.
the clear: left; just didn't work and added a the #headgradient on the next line. What would be the appropriate DTD for a simple html, css, js, php file?
Thats doctype is fine enough to use. <!doctype html> is the doctype for HTML5 and is backwards compatible, which is why I am starting to use it - just to get into the habit of it although you really won't be able to use HTML5 features across all browsers in production sites for quite some time.
I've switched careers...
I'm NO LONGER a scientist,
but now a web developer...
awesome.
Bookmarks