Jump to content
Stef's Coding Community
Sign in to follow this  
emily01

CSS

Recommended Posts

Ok, so by the question you've guessed that I am super noob.

So far I have not seen how to make this work but here it is. Problem:

I uploaded an image that has color atop and fades to light toward the bottom. This was supposed to be my background image. I set it to be large enough to fill the entire page or screen which shows up fine. I wanted to add text on top of the background image but it keeps putting the text at the bottom of the image. What have I missed?

Do I need to do a "table background" to make the text appear on top of what is supposed to be a background but only showing up as a simple large image. I'm sorry if this is the dumbest CSS question but I really don't know.

Share this post


Link to post
Share on other sites

It sounds as if you are using a normal html image with the <img... > tag if the text is going below it. For a background-image you need to use

body { background: url(image.jpg) fixed top center no-repeat; } 

 

Put the above in a stylesheet or inside head section style tags <style type="text/css">........</style> and it shound cover the body background and then your html markup will show on top of it.

Edited by Wickham
  • Upvote 1

Share this post


Link to post
Share on other sites

Wickham, thank you so much for answering this question for me. You were right, I was using HTML img tag. I was using the old <body background> tag at that! This totally worked. I cannot believe in all my CSS/HTML books and sheets I could not find the answer to something this elementary in them. They seem to dive into the deeper stuff first. Thanks again!

 

It sounds as if you are using a normal html image with the <img... > tag if the text is going below it. For a background-image you need to use

body { background: url(image.jpg) fixed top center no-repeat; } 

 

Put the above in a stylesheet or inside head section style tags <style type="text/css">........</style> and it shound cover the body background and then your html markup will show on top of it.

Share this post


Link to post
Share on other sites

Books, to me, do not seem to be structured very well in teaching the very basics but that doesn't mean they are not good.

 

As suggested elsewhere, you don't need books because you have the ultimate online book right at your finger tips...it's called Google for Dummies (emphasis mine). :)

Edited by Eddie

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...