Jump to content
xisto Community
Sign in to follow this  

Need Help With JPEG Background

Recommended Posts

I'm just starting to design my website.


So far, it looks okay.

Here's a basic rundown:


index.html is divided into two frames: menubar.htm (25%) and "mainwindow" (75%).


The menu bar has about 7 images which, when clicked, open other .htm files in "mainwindow".

I want a background image "tsmg2.jpg" (which is in the same folder as everything else) to be behind the 7 link- images.


The image works, I know- I can code <img src="tsmg2.jpg"> and it will display it.


However, I want it as the background.


I've been coding <background="tsmg2.jpg"> and putting that right under the first <html> opening tag.


Why doesn't it show "tsmg" as the background for the other images?




okay, I found a css tutorial off google.


now, I need to know how to have only one image (not tiled)


I tried:


<style type="text/css">





background-repeat: no-repeat;




with no luck...


and can I have the browser auto-size it to fit the frame?

I know different browsers display different looks...

Edited by austiniskoge (see edit history)

Share this post

Link to post
Share on other sites

Okay. That works to place the image in the frame.But what about not tiling it?It's a small image, so after the first one displays at the top of the frame, it continues with more all the way down.Isn't it like:<body background="tsmg2.jpg" position="center">except that's like horizontal center, and I just want one vertically centered image.

Share this post

Link to post
Share on other sites

You would need to use CSS like

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

You might want to enlarge the image or it might work if you tried

body {background-image:url(tsmg2.jpg);         background-position:100% 100%}

Share this post

Link to post
Share on other sites

I had this very same problem as I have the exact same basic frame setup as you described except that my background is to the left, but while your background may remain un-tiled, if your text exceeds the length of your picture, the picture will also go up with the text as well instead of remaining fixed.In my honest opinion, something like that usually looks nicer if the background remains fixed while only the text and body images scroll (but that just might be me). :(So, here's what I did for mine (I changed it so it would fit yours):

<style type="text/css">body{background:url(tsmg2.jpg) fixed no-repeat center}</style>

Hope that made sense... :(

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.