HTML - Auto Stretch Webpage To Fit Different Windows
Hi guys,
Ok, i have dreamweaver 4, yes i know its and old version but it works for me. The question i have is proberly a simple solution for you guys but its been giving me a headache for ages. i want to create a webpage that will auto stretch to meet the users screen size when viewed from the web. Now i beleive its somthing to do with putting % in a table instead of numbers for the size? Ok, that bit i get, so let me ask in a little more detail. when i open dreamweaver 4 up, the 1st thing i do is create the main area for my content, in dreamweaver 4 this is defined by showing a green bordered box... Now is it this box area that i make sure to put the % figures in before i continue to then add more areas for content inside the main box so that the webpage when finished will auto stretch to any screen? Or do i have to % all the other areas i create withing the main webpage area too? regards Gary Similar TutorialsI'm trying to get into the grip of using CSS and what not. I know, I'm so way behind.... anyway, I have a master page and the first header content will have an image. I want the image to be indented about 20% in from the left, and I have done this using the css padding-left. That's cool The next concern is the image itself. is there a way for it to maintain some what the quality even when stretching it? So I have an img tag, and given it a fixed width and height for an image. of course, looks odd but I am trying to get some nice images in the header at random when loadtime. so.... is there a way to maintain the quality perhaps? Or maybe I am doing this all wrong? Hello, I just sliced a website template and i was wondering how i get it so the images stretch all the way across the screen instead of it showing the background. http://www.legouniverseforums.com/blowupreviews.html here is the link to it if you would like to edit my code that would be great. All help appreciated. Hi Don't know if this is the correct forum, but I will add it here. I am doing a new site, and trying my best to get it working in IE6. Everything is going OK with the set up so far. However, I have to use PNGs for a drop shadow. (if anyone knows a better way, btw, that works in IE6, please tell me :-) ) Anyway, all the positions, etc are correct and they become transparent. The issue is they seem to be getting a larger vertical size than they should have. You can see this on the top corner shadow, as it overlaps the one below. Test Page Is there a cure for this? Can anyone help? Thanks in advance Sorry if i posted this in the wrong location. So im a real estate agent making a website. Im no pro and most of the stuff ive been using to build has been through layouts/generators/help of others such as yourselves. So ive been stuck on finding/making this code for the past couple of days. So all my listings are on my agencys website, not my personal agent website. Is there a code i could have where in the listings page my my personal agent website, i could have a window maybe 600x900 of the listing page on my agencys website? To kind of clear things up, you know how when you google something you have the magnifying glass, how it gives that preview. How can i have that preview coded onto a webpage, but me say what webpage to preview and how big to make the preview box? Tried to explain it as best i could. If you dont know the code, if you can tell me what its called so i can try to narrow the google searches. So far everything that has been coming up in the search restults has been preview boxes to preview html codes you have already written. Fail Blog Thanks Hi, I have a fixed width and height images <img width="200" height="300" src ... /> and several images of different size. How can I avoid to stretch the images and just crop them ? thanks Hi, I'm making a website template, and I'm about finished. I'm having trouble though, I want the table on the bottom right, the "MAIN" table with content saying "MAIN" to stretch 100% so even if the typing doesn't reach the end of the table, it will still stretch, and I have no Idea what wrong. Any help would be appreciated. the full code is attachted im trying to stretch a image for the top of my page here is a code i saw on another page that was working but i cant get it to work for me and i cut / paste it, so i cant figure this out... heres the code i used... im confused why its a background = when its only the top background on his page... i just wanted this to be the top banner of my page and have it stretch acording to the viewers screen size, any help would be great... <tr class=td2><td class=td2;align="center" colspan="2"> <table border="0" cellspacing="1" width="100%"> <tr> <td width="100%" background="banner-top.JPG"> <table border="0" cellpadding="0" cellspacing="0" width="100%" bordercolor="#FFFFFF"> <tr> <td width="100%" background="banner-top.JPG" height="80"> <p align="center"><font color="#FFFFFF" size="3" face="Arial"><b> </b></font></td> <font></td> I want to know how to make a div stretch to the full height of a container! Here is the html: 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> <title>This site is currentely out of order! Chack back later.</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="container" style="display:block"> <div id="leftside" style="display:block"><img src="images/leftside.gif" alt="" /></div> <div id="logo" style="display:block"> <img src="images/logo.gif" alt="" width="315" height="140" title="" /> </div> <div id="content" style="display:block"> <br /> <br /> <br /> <br /> <br /> <br /> </div> </div> </body> </html> And then the css: Code: /* START - Master */ div {display:none} /* Keep NO MATTER what - Keep at top */ body {background-color:#000000; background-image: url('images/watermark.gif'); background-repeat: no-repeat; background-attachment: fixed} #container {width: 85%; margin-left: 7.5%; background-color: #666666; color: #030303} #leftside {float: left; min-height: 100%; height: 100%; background-image: url('images/leftside.gif'); background-repeat: repeat-y} /* END - Master */ /* START - Header - No change */ #logo {width: 85%; margin-left: 7.5%; background-color: #7B7B7B; text-align: left; font-size:15pt; border: none} /* END - Header - No change */ /* START - Content */ /* END - Content */ /* START - Footer - No change */ /* END - Footer - No change */ The "leftside" image is supposed to be the full length of the header + content. Thanks! Hi guys, It's my first time on these forums, and I thought you all would be the best help I could get for my HTML problem. I've just recently created a blog and I am currently using a custom template. I'm not too familiar with HTML, or any sort of coding really, and I would like to stretch the content area of the template so that I could place larger images without it overlapping the grey bars. I have no idea what values to change though or what I should be looking for. Could you guys help me out? Many thanks, AciesEdge I made some slices in photoshop to manage the links from Front Page but the links look like this.Check the photo... any one knows what shall i do ? Hi There, Pulling my hair out over this. For the life of me, cant make it work: http://www.cowboytuffwebsitedesign.c...cialdeals.html I've used positive padding negative margin to stretch both div's heights to match each other. But the content div, when needed to be higher than the menu div, will overflow its content past the container divs bg. As well the footer will only clear past the menu div, not the content div. HELP! PLEASE! I can copy and paste HTML right into the thread if needed. Thanks Hey there, I'm trying to code my site for not only IE8 but also IE6/7 versions. I can't seem to figure out how to download the earlier versions without either getting rid of IE8 or just not being able to download them. Is it possible for me to have IE6, 7, and 8 on one computer? Thanks, ~C-Style~ Hi all, newbie here. I'm trying to make an "interactive" music video where a user clicks images which trigger pop up windows playing youtuve videos to appear. My problem is keeping the pop up youtube videos "on top" while retaining the user's ability to click on the interface of the original webpage (to trigger more videos). any ideas? Any help would be greatly appreciated. thanks in advance I have to write a html code where i have to jump to 2 urls on click a object. presently i have written a code to jump to one url only "<a href=\"http://bodev:8080/OpenDocument/opendoc/openDocument.jsp?iDocID=AdknCqrhpYZKkFBzpe1wbsU&sIDType=CUID&sType=wid&sRefresh=N&sWindow=New\" title=\"\" target=\"_self\" nav=\"doc\">"+"Click State"+"</a>" When I click the object with text Click State, a new window pops ups with url. So, the requirement is now to pop open 2 windows when i click Click state The first url is as above and the second code is "<a href=\"http://bodev:8080/OpenDocument/opendoc/openDocument.jsp?iDocID=AYhtqwsujalMpBHSjfT0hF0&sIDType=CUID&sType=wid&sRefresh=N&sWindow=New\" title=\"\" target=\"_self\" nav=\"doc\">"+[State]+"</a>" Note: My program embeds these codes, so i need to use <a href> and </a> Popup Windows: The Basics We'll begin the tutorial by creating a basic popup window. The technique described here addresses all the major issues in popups. The popup always comes to the front. Different links can target the same popup. The code is simple and easily modified. Everything for the rest of the turorial is a variation on the theme described here. The code in this page creates a popup that is opened from a link. In this section we'll show the code with just the minimal description you need to get it going. First, copy this script into the <HEAD> section of your page: HTML Code: <SCRIPT TYPE="text/javascript"> <!-- function popup(mylink, windowname) { if (! window.focus)return true; var href; if (typeof(mylink) == 'string') href=mylink; else href=mylink.href; window.open(href, windowname, 'width=400,height=200,scrollbars=yes'); return false; } //--> </SCRIPT> For now we'll skip the details of how the script works, and move to the next step. The script above opens the popup, but something needs to run the script. The most common situation is that the script is run when the user clicks on a link. A link like the following would run the script: HTML Code: <A HREF="popupbasic.html" onClick="return popup(this, 'notes')">my popup</A> Most of the link is as usual. The URL of the page being linked to is in the HREF attribute. We've added an additional attribute called onClick. Copy the code as it is into your link, with only a small modification. The second argument of the popup() -- 'notes' -- indicates name of the popup window. Every popup window should have its own unique name. Be sure to put the name in single quotes (''). So if you want to name the popup 'stevie' then this would be the code: HTML Code: <A HREF="popupbasic.html" onClick="return popup(this, 'stevie')">my popup</A> Read This Next Part Or You'll Go Insane Trying to Figure Out Why Your Popup Doesn't Work A small but crucial point is often overlooked. The command in onClick must begin with return or the script won't work. Be sure to start the command with return like this: HTML Code: onClick="return popup(this, 'notes')" And don't put a space in the page name between the single quotes. If you do, the link will act just like a regular link. Popup Windows: From an Image Map In our first variation we'll open the popup from an image map instead of from a regular anchor. We'll use the same script as from our first example. With that script, an <AREA ...> tag in an image map can be made to open a popup in exactly the same way as an <A ...> tag: HTML Code: <MAP NAME="index"> <AREA HREF="mypopup.html" ALT="My Popup" COORDS="10,10,120,120" SHAPE=RECT onClick="return popup(this, 'gloss')"> <AREA SHAPE=RECT ALT="Your Popup" COORDS="140,10,180,50" HREF="yourpopup.html" onClick="return popup(this, 'gloss')"> <AREA SHAPE=DEFAULT NOHREF> </MAP> <IMG SRC="mymap.gif" HEIGHT=130 WIDTH=190 ALT="Image Map Example" BORDER="0" USEMAP="#index"> Popup Windows: Opening Automatically In the first two examples (Popup Windows: The Basics and Popup Windows: From an Image Map) the popup is opened when the user clicks on something. In this example the popup opens automatically. We'll use the same script as in the first example. Copy this script in the <HEAD> section of your page: HTML Code: <SCRIPT TYPE="text/javascript"> <!-- function popup(mylink, windowname) { if (! window.focus)return true; var href; if (typeof(mylink) == 'string') href=mylink; else href=mylink.href; window.open(href, windowname, 'width=400,height=200,scrollbars=yes'); return false; } //--> </SCRIPT> This time, instead of running the script from a link we'll run it from the onLoad attribute of the <BODY ...> tag. HTML Code: <BODY onLoad="popup('autopopup.html', 'ad')"> The command in onLoad is run when the document is finished loading. Like in our previous example, the command runs popup(), but this time the first argument for popup() is a little different. In the previous example we put this, meaning the link itself, and the script got the URL from the link. In this case there is no link so we pass the actual URL to open. So in our example we put 'autopopup.html'. Popup Windows: From a Form For our next variation on the popup theme we're going to open the popup from a form. In this example we're going to change the script around. The following script is custom designed for opening a popup from a form. It works with forms that use both POST and GET. Copy the following script exactly as-is into the <HEAD> section of your document: HTML Code: <SCRIPT TYPE="text/javascript"> <!-- function popupform(myform, windowname) { if (! window.focus)return true; window.open('', windowname, 'height=200,width=400,scrollbars=yes'); myform.target=windowname; return true; } //--> </SCRIPT> Now we'll add some code so that the popup opens when the user submits the form. Add an onSubmit attribute to <FORM ...> tag: HTML Code: <FORM METHOD=POST ACTION="../cgi-bin/mypopupcgi.pl" onSubmit="popupform(this, 'join')"> The first argument for popupform() is always this, meaning the form itself. The second argument, 'join' in this case, is a unique name for the popup. Popup Windows: Targeting the Opener Once a popup window has been created, linking from the popup back to the main window (i.e. the window which opened the popup) is a little trickier than might be expected. The problem is that the main window doesn't have a "name" the way the popup window does. Fortunately, JavaScript provides an answer in the form of opener. To create links in the popup window that target back to the main window, first put this JavaScript in the <HEAD> of the popup page: HTML Code: <SCRIPT TYPE="text/javascript"> <!-- function targetopener(mylink, closeme, closeonly) { if (! (window.focus && window.opener))return true; window.opener.focus(); if (! closeonly)window.opener.location.href=mylink.href; if (closeme)window.close(); return false; } //--> </SCRIPT> A link that uses this script looks like this: HTML Code: <A HREF="rbex.html" onClick="return targetopener(this)">my page</A> Popup Windows: Closing When They Go to the Opener In the previous example the link in the popup targets the main page, but the popup stays open in the background after the user clicks on the link. In this page we'll set the link so that it closes the popup after the click. targetopener takes three parameters. The first is always this, meaning the link itself. The second and third parameters are optional and default to false. (Notice we don't use them in the example above, we'll get to them shortly.) The second parameter indicates if the popup should close. The third is if the link should actually send the opener to the linked resource, or if the opener should just get the focus regardless of what its current page is. The third parameter provides a safe way to close the popup after closing, but still having a link to an existing page if the window isn't actually a popup (such as if the user found the page through a search engine). When the user clicks on the link, targetopener checks if the browser has the focus command (a few older browsers don't) and if the current window was opened by another window. If these conditions are true, then the opener window gets the focus, the opener is directed to the referenced URL, and the script returns false. Because the function returns false, the link does not go on to the URL (the script has already done that). Note that the link which targets the opener is a little different than the link that opened the popup window to begin with. In this link, onClick says "return goOpener(this)"... the links on the previous pages did not use return. By default, the popup window stays open but is in the background. If you want the popup to close after going back to the opener, add a second parameter of true to the targetopener function call: HTML Code: <A HREF="rbex.html" onClick="return targetopener(this,true)">main page</A> Hi. I'm trying to replicate an old app that used to be in the App Store. It let you log into xbox.com, and take your friends list and various other info, and put a nice interface over it. Right now I'm having real trouble even logging into xbox.com, or live.login.com. You can see my webapp here. For some reason it doesn't work. I even tried using all the HTML which doesn't seem to work either. Does anybody know how to fix this, OR another way to login to xbox.com to get the info. Thanks. hi guys, I am new here and my friend says he always gets help when he comes on this forum so I will follow in his foot steps. My problem is this; I am building my website and I have come up to a wall. I have 4 different playlist that I want to come out on a pop up window which I already configured and all but I can't seem to get my links to open in the same pop up window. I want to be able to click on a link and it opens it in the same pop up that is already there. Is that possible. This is the code that I am using: <p>These are our current playlists:</p> <blockquote> <p><a href='media/gospel playlist/gospel player.html' target="_blank" onClick="window.open('media/gospel playlist/gospel player.html', '', 'scrollbars=auto, menubar=no, height=500, width=400, resizable=no, toolbar=no, location=no, status=no'); return false;">GOSPEL</a></p> <p><a href='media/hiphop playlist/hiphop player.html' target="_blank" onClick="window.open('media/hiphop playlist/hiphop player.html', '', 'scrollbars=auto, menubar=no, height=500, width=400, resizable=no, toolbar=no, location=no, status=no'); return false;">HIPHOP - R&B - REGGAE</a></p> <p><a href='media/zouk playlist/zouk player.html' target="_blank" onClick="window.open('media/zouk playlist/zouk player.html', '', 'scrollbars=auto, menubar=no, height=500, width=400, resizable=no, toolbar=no, location=no, status=no'); return false;">ZOUK - KONPA - LATIN</a></p> <p><a href='media/jazz playlist/jazz player.html' target="_self" onClick="window.open('media/jazz playlist/jazz player.html', '', 'scrollbars=auto, menubar=no, height=500, width=400, resizable=no, toolbar=no, location=no, status=no'); return false;">LOVE SONGS - JAZZ - BLUES</a></p> <p> </p> </blockquote> Pleas help out if possible.. Thanks a bunch Hey guys. One of my pages is full of hundreads of pictures. When you click them in makes them bigger, but it makes them bigger on the same page. Does anyone have anything that can make any link that is clicked on that page open in a new window. Heres the site. www.jimandanne.net/pictures.htm help would be great, Thanks Hello! I am in need of some assistance with pop-up windows... Thisis an example of the code I am currently using for pop-up windows (below), it opens a new window that displays an image and it works great!... Only now I require the same format (including the text underneath), only instead of having the pop-up windows display images, I need them to display a body of text in html format.... Can anyone please assist me with this? Thank you!!! <center><html> <head> <style type="text/css"> div.img { margin:2px; border:0px solid #0000ff; height:auto; width:auto; float:left; text-align:center; } div.img img { display:inline; margin:3px; border:1px solid #ffffff; } div.img a:hover img { border:1px solid #0000ff; } div.desc { text-align:center; font-weight:normal; width:120px; margin:2px; } </style> </head> <body> <div class="img"> <a target="_blank" href="klematis_big.htm"> <img src="klematis_small.jpg" alt="Klematis" width="200" height="150" /> </a> <div class="desc">Add a description of the image here</div> </div> <div class="img"> <a target="_blank" href="klematis_big.htm"> <img src="klematis_small.jpg" alt="Klematis" width="200" height="150" /> </a> <div class="desc">Add a description of the image here</div> </div> <div class="img"> <a target="_blank" href="klematis_big.htm"> <img src="klematis_small.jpg" alt="Klematis" width="200" height="150" /> </a> <div class="desc">Add a description of the image here</div> </div> </body> </html> Hi, Wonder if you can help please. I have a long established ASP page called carkeys.asp - which does not work on my new Linux hosting (whoops should have know that). Before I change back to a windows platform is there anyway this page can be bounced to the replacement page at carkeys.html? The .asp page is well ranked with google and I would like its statistics to be directed to the new html page. I have code for the re-direction, but the page cannot be viewed to get this far. http://www.lockcity.co.uk/carkeys.asp > http://www.lockcity.co.uk/carkeys.html Many thanks for any help you can give Abi |