HTML - Background Image Issue
i was going to try to get my background to stretch but im running into too many issues with it, im wondering if any1 can help me get a background image start at top:150 left:280
here is what i tried so far with no luck:: <body background= image.gif position:absolute; top:150; left;150> doesnt work... so i tried setting up a div to call this into play... <style type="text/css"> #bg {position:relative; top:150; left:150;} </style> <div id="bg"> <body background ="background.gif"> </div> i also tried calling it with out a div threw the body and if i remember the image showed correctly but this time my page started over 150 x 150 px maby the image was just set as background tiled and wasnt even in the right spot i really dont know if any1 can please help me with this issue i would greatly appreciate the help thank you Similar TutorialsHi People, Another issue I am having with background images using div tags carrying on a little from http://www.htmlforums.com/html-xhtml...es-123021.html Although I can insert the background image now it does not appear to be taking much notice of the background image position or repeat elements. I could make life allot easier for myself and use a different method but wanted to learn this method. Any ideas why it would not take notice of my background positioning or repeat request? HTML Code: Header information and then........ </head> <body> <div id="content"> <div id="image1"><img src="images/image1.jpg" alt="image description"></div> <div id="image2"><img src="images/image2.jpg" alt="image description"></div> </div><!-- end #content --> </body> </html> CSS PHP Code: } body { width:100%;height:100%;margin:0;padding:0;background-color:#cccccc; } #content { width:100%;height:100%;margin:0;padding:0;background-color:#cccccc; } #image1 { background-image:url('images/image1.jpg'); background-repeat:no-repeat; background-attachment:fixed; background-position: right bottom; } #image2 { background-image:url('images/image2.jpg'); background-repeat:repeat-y; background-attachment:fixed; background-position: center; padding-left: 6px; } Adding the padding above does make the image move along with margins which i added for testing only but I obviously have something else not quite right here. I added sizes to the body and content as I was experimenting. Do I really need them, if so what is the recommended code to put in? Thanks all Hello. I have an HTML website image background that I am trying to stretch across any screen resolution, while keeping the image "fixed" in one position, so the image does not shrink when the screen window is modified. I got everything to work correctly, however I cannot get the image to stay at a "fixed size" when I shrink the window. Can somebody please help me? I am a beginner programmer, but I have tried numerous processes before resorting to this forum. Here is my code...in case you want to preview it in a web browser. Thanks in advance for any help you can offer me to get the image to stay "fixed" and also to keep it stretched across the entire screen. HTML Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!-- leave DTD out of DOCTYPE to put IE6 in quirks mode --> <html> <head> <title>GIS Disclaimer</title> <style type="text/css"> body { /* for IE; otherwise, BG isn't fully stretched */ margin: 0px; } #background { position: absolute; margin: 0px; border: 0px; padding: 0px; left: 0px; top: 0px; width: 100%; height: 100%; overflow: hidden; z-index: 0; background-repeat: no-repeat; background-attachment: fixed } #background img { padding: 0em; width: 100%; height: 100%; } #body { position: absolute; left: 0px; top: 0px; width: 100%; height:100%; padding: 0px; z-index: 0; } li { margin-bottom: 2em; } </style> <!--[if IE]> <style type="text/css"> body { margin: 0px; overflow: hidden; } </style> <![endif]--> </head> <!-- img must be encased in div to keep proper image aspect ratio --> <div id="background"><img src="file:///C:/Website/Images/Disclaimer_bckgd_5.jpg"></div> <div id="body"> <style fprolloverstyle>A:hover {color: red; font-weight: bold} </style> <div align="left"> <table cellspacing="0" cellpadding="0" align="center"><tr> <td width="100%" nowrap> <b><p style="word-spacing: 0in; line-height: 0px; margin-left: 0px; margin-right: 0px; margin-top: 175px; margin-bottom: 0px"; <span style="font-size:21.0pt; color:maroon" >Town of Leprechauns, Confusion<p style="word-spacing: 0in; line-height: 0px; margin-left: 0px; margin-right: 0in; margin-top: 40px; margin-bottom: 20px"; align="center"><b><span style="font-size:21.0pt;color:maroon">Online Disclaimer Form</span></b></p> </tr></table> <div align="left"> <table cellspacing="0" cellpadding="0" align="center"><tr> <td width="100%" nowrap> <p style="line-height: 0px; word-spacing: 0in; margin-left: 0px; margin-right: 0px; margin-top: 10px; margin-bottom: 0px"; align="left"><b><span style="font-size:12.0pt; color:black">This site provides access to the Online stuff. The information contained on this site is</p><p> updated periodically, however this town geographic database may NOT reflect the most current</p><p> information available. THE TOWN OF LEPRECHAUNS MAKES NO CLAIMS OR WARRANTIES,</p><p> EXPRESSED OR IMPLIED, CONCERNING THE COMPLETENESS, RELIABILITY, OR SUITABILITY </p><p> OF THESE DATA. THE TOWN OF LEPRECHAUNS DOES NOT ASSUME ANY LIABILITY ASSOCIATED</p><p> WITH THE USE OR MISUSE OF THIS INFORMATION. All information is for planning purposes only. </p><p> It may not be adequate for legal boundary definition, regulatory interpretation, or property conveyance</p><p> purposes. If you believe that any data provided within this site is inaccurate, or if you have any questions </p><p> regarding these data, please contact:</span></b></p> </tr></table> <table cellspacing="0" cellpadding="0" align="center"><tr> <td width="100%" nowrap> <p style="word-spacing: 0in; line-height: 100%; margin-left: 80px; margin-right: 0; margin-top: 0px; margin-bottom: 0"; align="left"><b><span style="font-size:12.0pt; color:maroon">Butch, GISP</span></b></p> <p style="word-spacing: 0in; line-height: 100%; margin-left: 80px; margin-right: 0in; margin-top: 0px; margin-bottom: 0"; align="left"><b><span style="font-size:10.0pt;color:maroon">Town of </span></b><b><span style="font-size:10.0pt;color:maroon">Leprechauns</span></b><b><span style="font-size:10.0pt;color:maroon"> </span></b><b><span style="font-size:10.0pt;color:maroon">GIS</span></b><b><span style="font-size:10.0pt;color:maroon"> Coordinator</span></b></p> <p style="word-spacing: 0in; line-height: 100%; margin-left: 80px; margin-right: 0in; margin-top: 0px; margin-bottom: 0"; align="left"><b><span style="font-size:10.0pt;color:maroon">41 Pot O Gold Road</span></b><b><span style="font-size:10.0pt;color:maroon">, </span></b><b><span style="font-size:10.0pt;color:maroon">Leprechauns</span></b><b><span style="font-size:10.0pt;color:maroon">, </span></b><b><span style="font-size:10.0pt;color:maroon">Confusion</span></b><b><span style="font-size:10.0pt;color:maroon"> </span></b><b><span style="font-size:10.0pt;color:maroon">90210</span></b></p> <p style="word-spacing: 0px; line-height: 100%; margin-left: 80px; margin-right: 0in; margin-top: 0px; margin-bottom: 0" align="left"><b><span style="font-size:10.0pt;color:maroon">Tel: </span></b><b><span style="font-size:10.0pt;color:maroon">555-555-5555</span></b><b><span style="font-size:10.0pt;color:maroon"> Fax: </span></b><b><span style="font-size:10.0pt; color:maroon; nowrap">555-555-5555</span></b><b> </b></p> <p style="word-spacing: 0px; line-height: 100%; margin-left: 80px; margin-right: 0in; margin-top: 0px; margin-bottom: 0"; align="left"><b><span style="font-size:10.0pt;font-family:"Times New Roman";mso-fareast-font-family: "Times New Roman";color:maroon;mso-ansi-language:EN-US;mso-fareast-language: EN-US;mso-bidi-language:AR-SA">Email:</span><span style="font-size:12.0pt; font-family:"Times New Roman";mso-fareast-font-family:"Times New Roman"; mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA"> </span><span style="font-size:10.0pt;font-family:"Times New Roman";mso-fareast-font-family: "Times New Roman";color:blue;mso-ansi-language:EN-US;mso-fareast-language:EN-US; mso-bidi-language:AR-SA"><a href="mailto:bdawg9674@hotmail.com"><i><span style="color:navy">bdawg9674@hotmail.com</span></i></a></span></b></p> <p style="text-indent: 0; line-height: 250%; margin-left: 50px; margin-right: 0; margin-top: 0px; margin-bottom: 0"; align="left"><b>Do you agree to the conditions listed above?</b></p> <p style="text-indent: 0; line-height: 250%; margin-left: 50px; margin-right: 0; margin-top: 0px; margin-bottom: 0"; align="left"><font face=Arial size=-1 color=#000000><a href="http://xxxxx.xxxxxx.xxx.xxx/website/xxxxx/parcels/login.htm"><input type="submit" value=" I Agree " onclick= "parent.location='http://xxxx.xxxxx.xxx.xxx/website/xxxxx/Parcels/login.htm'" style="font-family: Georgia; color: #000080; font-weight: bold"></a></font><font face="Arial"> <a href="file:///C://Website/xxxx.html"> <input type="submit" value="I Do Not Agree" onclick= "parent.location='file:///C://Website/Survey.html'" style="font-family: Georgia; color: #000080; font-weight: bold"></a></font></p> </tr> </table> </div> </body> </html> Is it possible to put a smaller background image on top (like in layers) of my old background image? I have a background image, but I want to put a smaller image on top of that one, but for it to be treated also as background image. This image is a black vertical rectangle, but is faded on the edges to give a transparency, so its a .png. So ultimately what I am trying to do is put this black rectanlge on top of my original background image and with the transparency on the edges of this image, be able to see my original background image. How can I do so? Also what I was thinking was that this faded background would be scaled to fit different screen sizes, so do "width: 75%"? Just so that it ALWAYS stays at 75% no matter what screen size it is viewed on. Is this the right approach towards getting this result? i want to know if i can make the background of this applet transparent to see the body background instead of a color <body background ="image.jpg" >(this is what i want to see and just the text of the applet if it is possible ) <p ALIGN="LEFT"> <applet CODE="starmenu.class" WIDTH="240" HEIGHT="1000"> <param name="demicron" value="www.demicron.se"> <param name="reg" value="A00037"> <param name="displace" value="1"> <param name="background" value="000000"> <param name="foreground" value="0000ff"> <param name="shadow" value="ff0000"> <param name="target" value="newbrow"> <param name="horizontal" value="Yes"> <param name="font" value="arial"> <param name="fontsize" value="20"> <param name="italic" value="Yes"> <param name="bold" value="Yes"> <param name="item0" value="blablabla"> <param name="url0" value="http://ep.html"> <param name="item1" value="blablabla"> <param name="url1" value="blablabla.html"> <param name="item2" value="blablabla"> <param name="url2" value="http://blablablal"> <param name="item3" value="Email"> <param name="url3" value="mailto:.com"> </applet> </p> ps: i took this from javafile.....not mine Thanks guys! I know IE7 sucks but i need my website to be viewable in it. First look at my site in Firefox, then IE7 if you have it. The menu shows up properly in firefox, but not in IF7. Any ideas how to make IE7 show the menu properly? Thanks link: http://www.dynamitedave.com/redesign/index_1.html Greetings, This is my first post... I'm a novice web developer and pro drummer running www.ProMusicTeachers.com. The site is php/mysql, we have a search function smack in the middle of the index page that is set up as a <table>. The table should have a background image... this is the code I'm using is <table border="0" bgcolor="#FF9900" background="/images/searchgraphic.jpg" align="center" cellspacing="3" cellpadding="0" width="617"> to create the table, then comes the form. However, the background image shows up only in Safari, but not IE or Firefox. This seems like a very simple tag... and I swear last night it showed up in Firefox too but this morning will not. Any suggestions? Much thanks, Brian Hello World! (Where did that tradition start anyways?) Yes, I am fairly new at web design, and am using the method of "search-Google-whenever-you-have-a-problem-as-you-go" to learn HTML. I am pretty happy with the results I am getting in Dreamweaver, but there is one nagging thing that is throwing a kink into my designs. I have the majority of the content that is unique to each page within a table cell (<td>). Since I wanted to have the background color of the cell match exactly to an image that tops off the page body, I decided to have the background be one pixel of that color that repeats across the whole table cell. Originally, I just defined the background in the starting tag using "style=" then specifying the background. (Dreamweaver made sure I had it right using its Code Hinting). The background shows up perfectly when in the Dreamweaver editing view, but when looking at the page in any other view (Live view, preview in browser, etc.), the background of that cell is just white. I tried defining the background with a CSS ID, which has worked on other parts of the page, but no beans. What am I doing wrong? Is the fact it is only one pixel that has to repeat an issue? Here is the code: <td width="100%" height="103" colspan="8" align="center" id="page_background_beige" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: solid; border-top-width: 1; border-bottom-style: none; border-bottom-width: medium;"> <!-- TemplateBeginEditable name="Body" --> //In here goes all of the content of the page <!-- TemplateEndEditable --></td> The CSS: #page_background_beige { background-image: url(Background_Pixel.png); background-repeat: repeat; } Thanks, Wookieguy (Heh, I know tables are a fairly sloppy way to do things, but this is a fairly simple site anyways.) Hi, I'm a complete newb and html-challenged, so please forgive my stupid questions. This is what I want for the personal website I'm making: a fixed image as the background that covers the entire screen regardless of what screen resolution a user's computer has - this much I've managed with CSS...I think (like this right? http://www.geocities.com/serenamonster/index.htm ) clickable regions on this background image to use for navigation to various parts of the site. Or in other words, the background image as an image map. - this I'm having trouble with, because you have to designate the picture as a set # of pixels in dimension to make an image map right? and if I do that to my background image, then it may display too big or too small depending on the person's screen resolution right? So does anyone know how I can have clickable regions on my fixed background image without the image being too big for low resolutions or too small for high resolutions? (he http://www.geocities.com/serenamonster/map.html the background image is fixed at 800x400. I want to make each star on the image a hyperlink to a different part of the site). I read somewhere that standard is 800x600 to fill a person's browser right? But on my computer the image only covers about 2/3 of the browser screen which is too small. How can I make it so that it fills 100% of any viewer's screen regardless of resolution? How does it look on your computer? I know these are probably just really stupid questions because I'm missing something really fundamental...but any help would be greatly appreciated! Thanks! ~Serena P.S. is it possible to do mouseovers for certain coordinates on an image map? This is the current script I am using for background change upon a timer, does anyone know how and where I can add a no bg repeat and position the image on the bottom left? Any help would be great! Thanks <script type="text/javascript"> var bgImages = new Array(); bgImages.push("/image/girl.gif"); bgImages.push("/image/girl2.gif"); bgImages.push("/image/girl3.gif"); //bgImages.push("URL HERE"); function LoadRandomBackground() { var randomImageIndex = Math.floor(Math.random()*bgImages.length) document.body.background = bgImages[randomImageIndex]; } function StartBackgroundRefreshTimer() { var timer = setInterval('LoadRandomBackground()',10000); // 10 seconds } </script> </head> <body onload="LoadRandomBackground(); StartBackgroundRefreshTimer()"> Can somebody give me a full code <div style=""> for putting background images in divs... thanks in advance for you're help! Hi Guys, Firstly i apologise if this in the wrong section of the forum, please let me know. My problem: I have designed a webpage for my DJ services in Photoshop and plan to slice it up. The first problem is my background. I designed it myself so its not simple. Basically i dont have a clue on how i should export the background from CS5 or how to implement it into my website on dreamweaver cs5. Also i want to export my images once sliced from Photoshop with a transparent background, how would i do this? Thanks for any help Raver910 Hey everyone. I'm not too experienced in HTML and I'm having a problem with displaying a background image on this site I'm building. I know this probably isn't the best way to be doing what I'm trying to do, but I'm using a Frameset with 3 columns. The left and right I just want to display the background image and the main to be another frameset containing the main website content. It looks perfectly fine in Firefox, but in Internet Explorer the background images in leftMargin and rightMargin don't show; it's just blank. Here is my index.html file: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>| Totaro's Restaurant |</title> </head> <frameset cols="15%, 70%, 15%" border=0> <frame name="left" src="leftMargin.html" /> <frame name="main" src="main.html" /> <frame name="right" src="rightMargin.html" /> </frameset> <noframes> I'm sorry, it seems your browser doesn't support frames! x( </noframes> </html> and here is the code of one of the margins: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <style> body { background-image:url(images/bg.jpg); background-repeat: repeat; } </style> </head> <body> </body> </html> Here it is in Firefox: http://i34.photobucket.com/albums/d1...itefirefox.jpg And in IE: http://i34.photobucket.com/albums/d1.../websiteie.jpg Any help would be appreciated. Hello, Well im trying to make a web page type thing and i was wondering if there is a way to make the background change as if it were an image when you shrink the page down. http://www.legouniverseforums.com/radio.html thats the link. i want the video chat to be on the orange part box and the chat to be in its box but on some computers they go in there boxes but on other computers they dont. Here is how it looks on mine i would like it to look like this on every computer. http://www.legouniverseforums.com/Sc...34.34%20PM.png i'm trying to set an image from my harddrive as the background but it doesn't seem to be working. I've been trying <body background="image location.jpg"> but it doesn't work. Any thoughts or solutions? thanks How would I do this? Hey, I'm wanting to use a larger background image with a height of around 810pixels. Currently when i implement it, only around half the image appears and there is no scroll bar to use to view the whole image. And currently when i put a css box into it, when i scroll down it will still only show the top section of the image. Can anyone assist in what code to put into the CSS to allow the scroll bar to appear so i can view the whole background image? Thanks (sorry, meant to put this in the CSS section, only just realised) Hello, 1) I need to know how to make my background image the size of every monitor that will view it in any browser? Any idea? OR at least the size of most monitors 2) Also, how do I make is stick so it doesn't scroll, everything scrolls above it or on it. If the answer is CSS could you please write out a bit of code for me and tell me where to put it. Pretty please, with sugar on top. I know it sounds lazy, but I use to now CSS can't remember anything now and I'm suffering from short term memory loss which is new for me. I have to relearn everything and remember it - hard to do when you can't remember what you did 5 minutes ago. ~eDee Hello All, I hope this is a good place to ask my question. I was working on a a webpage and tinkering with two different screen capturing software to capture my website then all of a sudden I realized I can no longer see the background of my webpage. I can go online and see background images of someone else webpage but no the webpages stored on my computer. If anyone has any idea about the cause of the problem please help. Eyup people I was just wondering how I would go about centering or stretching a background image on a webpage without it doubleing itself. i hope that makes sense lol... sorta like when you set a wallpaper on your computer screen and set it to "tiled", there maybe more than 1 image showing. Id just like it to be stretched. any help would be appreciated thanks Is it possible to declare background image separately and use it in body tag to declare it as background using it's id ???? please reply.... |