HTML - Website Background
I am currently designing a website and I have to allow the user to change the background to a colour of his/her liking. I have a javascript function which works fine, but the problem is when you navigate to a different page the background colour will change to the default colour. I need to somehow allow the user to change the background colour for the entire website from any given web page. Below is the function i am using. Thank you in advance for your assistance.
<script type="text/javascript"> function bg_color(c){ var b = document.getElementsByTagName("div")[0]; var d = document.getElementsByTagName("body")[0]; b.style.background = c; d.style.background = c; } </script> Similar TutorialsI have the following question: I have a website with a background image and on that background image I have some text. When I scroll down I want my background to stay where it is and only the text should scroll down. What should I do to make this like that? Hi, I'm wondering if there is a way to ensure that my website background will work with any resolution i.e. will the flowers stay flush with the bottom corner of the page? http://imageshack.us/photo/my-images/819/bg1ev.jpg/ Hello everyone! I am so grateful that there are sites like this to help those like me. I'm ready to be hit by rotten tomatoes because my method for building my first site probably breaks tons of rules. I used Photoshop to create a webpage by slicing a single image with the intention of laying it out in a table. When I first sliced the image and simply set each image using "img src=" in each Table Data cell, it came together fine and looked perfect. The problem happened when I made one of my images the background image for the cell. The reason I did this is because this is going to be my main "Content" area and I want to be able to enter content over the image. For some reason, right when I made this change, the cell directly to the left of my "main content cell" is pushing to the right and creating unwanted blank space...and I can't for the life of me figure out why. I'm pulling my hair out and I'll probably cry myself to sleep tonight. I thought it was my HTML and found a tiny bit of CSS to help, but the problem remains. Thanks so much in advance for any assistance you can provide. The site is here (I added red borders to the table for assistance with review): http://www.geocities.com/mena_beena/Rosco.html Here is my HTML: Code: <html> <head> <link rel="stylesheet" type="text/css" href="rosco.css" /> </head> <body bgcolor=black> <table bordercolor=red border=1 cellspacing="1" cellpadding="0"> <tr> <td colspan=3><img src="Template4_01.jpg"></td> </tr> <tr> <td colspan=2><img src="Template4_02.jpg"></td> <td><img src="Template4_03.jpg"><br><img src="Template4_04.jpg"></td> </tr> <tr> <td><img src="Template4_05.jpg"></td> <td class="bg">asdfasdf</td> <td><img src="Template4_07.jpg"><br><img src="Template4_08.jpg"><br> <img src="Template4_09.jpg"><br><img src="Template4_10.jpg"></td> </tr> </table> </body> </html> Here is my CSS Stylesheet: Code: td.bg{ background: url(Template4_06.jpg); } Hi, I have an image "m1" set as the background of a table on my website. The table is set to the width of the image "340". However, when I add text it pushes the border and the image repeats/cuts off. http://www.monkeygambling.com/newpage.htm This problem only happens in IE, not in opera. Can anyone help? thanks i am currently using wordpad and making a website on rappers i am trying to add a video which will be a FULL-SCREEN video for the background but i dont have a clue what to do i have this at the moment to stream the video <img border="0" dynsrc="John Cena 6th Titantron.wmv" start="fileopen"> please help Hi guys, I'm currently trying to sort out the background for a website. What I'd like is to have a silhouette of a few people on a gradient background. I'd like to keep the quality high, but it also makes the file size large. If there were no silhouette then I would have a one pixel strip of the gradient set to repeat. Is it possible to add two background pictures, or is there another way I can reduce the file size that I hadn't thought of? Hello everyone I have run into a roadblock. I am trying to make a background image scale properly with Internet Explorer. I have successfully made the image fit the web browser right, using this code in a CSS class. The code I am using is as written: PHP Code: body.background { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../Images/Website Background-3.jpg', sizingMethod='scale'); -ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../Images/Website Background-3.jpg', sizingMethod='scale')"; } this code makes the background I am using work correctly in Internet Explorer. However, when I use this code, it makes the rest of the website stop working. I can no longer click on any of the links on the page, or anything of the sort. However, all my styles for the links still remain on the page. Any suggestions? Thank you all, Mitch Guzman I've got another problem with my website. I've taken a screenshot that I wanted for my website background. But since it was took on my screen, it doesn't fill the screen on wider monitors. I'm just wondering if there's any information on auto-resizing a website background. Or is it a scirpt/CSS/php style thing? This problem seems abit more complex than me previous problem. I'm on a 19 inch monitor. Here is my website for those that have bigger screens than me. http://www.dawncraftmc.com/ I have some links (in the header, the SUPPORTERS) to different websites, but when I click on them the address in the address bar does not change to the address of the website that I clicked. How do I make it show the address that I clicked on? Thanks. http://www.ac.wwu.edu/~fencing/ I am a total noob but volunteered to administrate the website, because there was no one else to do it. hello, i need a website for german customers, somethign like www.podmod.de because i would like to offer the same. So if anyone has an idea where to start, or even can offer me something i can buy, please do so. my email: verenamueller999@web.de thanks verena. Hi How to add a website counter to my website. So that when ever a visitor visits the website I want the counter to increase say from 101 to 102 and then for a new visitor it should be 103 and then again for the next visitor 104 and so on..... I want to know the code. There are number of websites that are offering this but they put their advertisement which I don't want Hi, I am trying to find a way in which a website that is linked on my homepage can be opened while keeping at least one form of my homepage open as well. e.g.: Google images :http://images.google.com/imgres?imgu...en-us%26sa%3DG sorry for the massive link. Hope you get the idea. So what i want is to have a bar on top that is my homepage (like the google bar in the link), but the rest is the actual website that has been linked. I don't really care much about the url. It doesn't have to be my homepage url, it can be the actual website url. Google has been able to do that somehow, so it is possible. I would just like to know how and if it is hard to do. If someone knows how to do it, it would be great if you could give me a link to a tutorial, or explain it. thanks 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? im not all that great at html and i am making a website for my guild on WoW. i was trying to create a basic layout, but it kept getting screwed up. heres the homepage: http://www.freewebs.com/animefreak98/home.htm. i made the whole page a table because i wanted it to have a back behind the tables, so i made the whole thing a table and seperated everything with colums. the colums are all screwed up. im trying to get them to line up, top to bottom and centered. here is the html: HTML Code: <title> Rise of the Horde (Alexstraza) </title> <table border="15" width="800" height="100%" align="center" valign="top" bordercolor="brown" background="http://www.freewebs.com/animefreak98/riseofthehord%2Dlarge.jpg" bgalign="center" cellpadding="0"> <th> <tr> <td align="center" valign="top"><a href="http://www.freewebs.com/animefreak98/home.htm"><img src="http://www.freewebs.com/animefreak98/banner.bmp"> </td></tr> <br> <tr> <td bgcolor="tan" border="2"><a href="http://www.freewebs.com/animefreak98/index.htm">-Home-</a></td> <td bgcolor="tan" border="2"><a href="http://www.freewebs.com/animefreak98/members%20page.html">-Member's Page-</a></td></tr> <br><br><br> <tr> <th align="center" valign="center"> Rise of the Horde </th> </tr> </table> </tr> </td> basically i want the banner to be at the top center of the table. i also want the two links to appear like buttons under the banner. then i want the header and wutever else i put under the links. please help me Hello, I am trying to set up a website with no such luck. I have some experience with html however I have no idea how to create what you could call "HyperLink Boxes". Can anyone help me with settings boxes around the 6 labels within this code. it is all on a picture so I can not link the text. Code: <html> <style type="text/css"> body { background: url(http://s1.postimage.org/g8k7foy94/Void_Craft.png) fixed center no-repeat;} </style> </html> The website is hosted at Voidcraft.net with a godaddy registration and its DNS'ed to a free hosting site called 000webhost with the following allowed scripts. Mysql PHP Cron jobs CSS Can anyone with allowing me to link the images that is all 1 image while doing so invisibly? If so, thanks Hi all im new to the forums and hope I can get some help to solve a few nagging coding problems. I run a radio control car website for people that own a GV or XTM model car, some of you yourselfs may own one. A friend and I decided that the site needed a new look to make it look a bit more pro, we found a template that we liked but its come to a point where really we arnt sure how to solve the problems that are coming up. The template didnt come with a sub page so to say, so any sub pages we use that the buttons link to are from the index page and our html coding is limited, if we could of created our site from scratch we would of but we are not experts in the html coding area, its limited and we have learnt it ourselfs. Our website is GV & XTM Models Our main problem is sorting the background to how we want it in terms of expanding downwards to match with the rest of the page and to allow the page to show the text we have put there. An example of one of our problems is this page link where some of the text goes into the border title headline margin bit. Now I have done what I can to try solve it but I have failed...damn it! Also every time we try to expand the page to fit more text in we end up with the background going out of sync/out of line meaning we end up with some or a huge white background appearing resulting in none of the text being shown so no one can read it. We want to create a subpage from the index coding we use but we have pretty much failed and racked our brains to the point of "god what do we do". A sub page that is coded right and to allow us put a good amount of text in without distoring the lovely background and design we use would solve our problem as we are wanting to get the website sorted as soon as possible. If you have any other questions regarding how my friend and I have coded the site etc PM me or reply here, a little bit of help would be appreciated alot, thanks all. PS I am using Dreamweaver 8 Hi I am new to these forums, I am currently building a website from a template I purchased. It is coming along well but I am now stuck when trying to use the first page of my website as an ebay listing page. Of course when I upload my new ebay page there is nothing but text and broken links. How do I connect this html in my ebay listing page with my source code on my website?. Or do I have to upload all image files for borders and headers to a server separately and link straight to them one by one?. Is it to do with the very top html on the page where it says similar to href source etc etc?. My website is fine since I have uploaded all the necessary files to the directory so linking all the images etc. Really appreciate some help I have been stuck for weeks trying to get the graphics to work on my ebay page. Nevermind i figured it out So i want my items in rows on my product page but with the shopping cart layout the way it is i can figure it out.I'm actually looking for someone to help me build it.I would especially like to be able to ask you to do something and then see it done and put on the website.I would be willing to pay for everything done.If anyone can help please let me know. Hi guys, my first post so hi to you all i need some help with a website i made(i know it isn't the best website in the world lol),but its my 2nd one ever so i am proud of it lol, i made the template in photoshop,sliced it in Imageready and i want to make it so i can put my text on to the main grey bit but can't figure out how for the life of me lol,can anyone tell me how to make it so i can write over the main section? is it even possible? Cheers, me |