| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
DIVs
So I finally decided to stop using nested tables and tried the div's route. Here's my code and followed by that will be the questions:
Code:
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>mysite.com</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onLoad="MM_preloadImages('images/menu_r1_c1_f2.gif','images/menu_r2_c1_f2.gif','images/menu_r3_c1_f2.gif','images/menu_r4_c1_f2.gif','images/menu_r5_c1_f2.gif','images/menu_r6_c1_f2.gif','images/menu_r7_c1_f2.gif','images/menu_r8_c1_f2.gif')">
<div style="position: absolute; left: 0; top: 0; width: 800; height: 72">
<span style="position: absolute; left: 0; top: 0">
<img border="0" src="images/logo.jpg" width="800" height="72"></span></div>
<div style="position: absolute; left: 200; top: 72; width: 25; height: 25">
<img border="0" src="images/rndmenu.jpg" width="25" height="25"></div>
<div style="position: absolute; left: 0; top: 72; width: 150; height: 25; z-index:0">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="200" id="topleft_border" bgcolor="#990000" height="25">
<tr>
<td> </td>
</tr>
</table>
</center>
</div>
</div>
<div style="position: absolute; left: 0; top: 95; width: 150; height: 40">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="200" id="userlogin" bgcolor="#990000" height="40">
<tr>
<td align="center"><font color="#FFFFFF" size="2"><b>User ID:
</b></font><input type="text" name="userid" size="15"></td>
</tr>
<tr>
<td align="center"><b><font size="2" color="#FFFFFF">Password:</font></b><input type="password" name="pword" size="15"></td>
</tr>
</table>
</div>
<div style="position: absolute; left: 0; top: 139; width: 200; height: 160">
<table border="0" cellspacing="0" cellpadding="0" width="200">
<tr valign="top">
<td bgcolor="#990000"> </td>
<tr valign="top">
<td valign="left" bgcolor="#990000">
<a href="http://www.gohere.com" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Home','','images/menu_r1_c1_f2.gif',1)">
<img src="images/menu_r1_c1.gif" alt="Home" name="Home" width="150" height="20" border="0"></a>
<br>
<a href="http://www.gohere.com" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('AboutMe','','images/menu_r2_c1_f2.gif',1)">
<img src="images/menu_r2_c1.gif" alt="About Me" name="AboutMe" width="150" height="20" border="0"></a>
<br>
<a href="http://www.gohere.com" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Articles','','images/menu_r8_c1_f2.gif',1)">
<img src="images/menu_r8_c1.gif" alt="Articles" name="Articles" width="150" height="20" border="0"></a>
<br>
<a href="http://www.gohere.com" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Assign','','images/menu_r7_c1_f2.gif',1)">
<img src="images/menu_r7_c1.gif" alt="Assignments" name="Assign" width="150" height="20" border="0"></a>
<br>
<a href="http://www.gohere.com" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('ClassSc','','images/menu_r3_c1_f2.gif',1)">
<img src="images/menu_r3_c1.gif" alt="Class Schedule" name="ClassSc" width="150" height="20" border="0"></a>
<br>
<a href="http://www.gohere.com" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Contact','','images/menu_r4_c1_f2.gif',1)">
<img src="images/menu_r4_c1.gif" alt="Contact Me" name="Contact" width="150" height="20" border="0"></a>
<br>
<a href="http://www.gohere.com" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Control','','images/menu_r5_c1_f2.gif',1)">
<img src="images/menu_r5_c1.gif" alt="Control Panel" name="Control" width="150" height="20" border="0"></a>
<br>
<a href="http://www.gohere.com" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Grading','','images/menu_r6_c1_f2.gif',1)">
<img src="images/menu_r6_c1.gif" alt="Grading Scale" name="Grading" width="150" height="20" border="0"></a></td>
</tr>
</table>
</div>
<div style="position: absolute; left: 200; top: 346">
<img src="images/brndmenu.jpg" border="0" width="25" height="25">
</div>
<div style="position: absolute; left: 0; top: 346; width: 200; height: 25">
<table border="0" cellspacing="0" cellpadding="0" width="200" bgcolor="#990000" height="25">
<tr>
<td> </td>
</tr>
</table>
</div>
</body>
</html>
In red, I have an image that gives a rounding look. How do I make this move down as the text (which I haven't added a part for yet), gets longer? It has to remain in that location from the left, but I want it to move down. I don't even know where to begin with this as I am used to only doing the web application programming. Maybe someone could point me to a good tutorial...thanks JMH
__________________
jmurrayhead Did I help you out? Make me popular by clicking the icon!New Members:Proper way to post a question Powered by ASP.Net |
|
#2
|
||||
|
||||
|
you won't be able to use position: absolute, AND have the text cause the image to move down. You need to find a way to position the image where you want it...in the normal flow of the document...or maybe using float.
__________________
ShepherdWeb :: Charging Rhino Wizard I know of no more encouraging fact than the unquestionable ability of man to elevate his life by conscious endeavor. {Henry David Thoreau} § shepherdweb.com § fariswheel productions § reagan administration |
|
#3
|
|||
|
|||
|
Quote:
I knew I couldn't use position absolute, I think that one is self-explanatory. I'm just not sure how to go about doing this. Guess I should have spent more time with the layout portion of my sites. |
|
#4
|
||||
|
||||
|
Quote:
Do you have a link to your site I can see? |
|
#5
|
|||
|
|||
|
Quote:
unfortunately, it's not up yet. I'm just running it on IIS on my lap top. |
|
#6
|
||||
|
||||
|
Quote:
that's cool, just wondering. When you first start doing designs with the idea of doing them "tableless", it feels like all your tools are broken. I remember it seemed like kind of a stiff learning curve at first. I think you're on the right track though! (if it's any consolation) |
|
#7
|
|||
|
|||
|
Quote:
lol, thanks. I just wish I knew what I was doing. Know if any good tutorials around? |
|
#8
|
||||
|
||||
|
Quote:
It is a stiff learning curve, but worth doing. A very good book that I can recommend is "Eric Meyer on CSS". It is project based and gives a good grounding on CSS. Including and this is the bit I like... converting existing table layouts to CSS. |
|
#9
|
||||
|
||||
|
Quote:
I recommend that book as well. It's probably a tiny bit advanced if you are a brand new beginner with CSS. I started with this book by Molly Holzschlag. It was REAL good. She has a newer on that I haven't read yet that is probably good too. |
|
#10
|
|||
|
|||
|
Thanks, I will check these out. I've dealt with a some style sheets before, but it was just basic things like what happens to a link when a user hovers over it and such. I'm trying to be able to develop more complex sites now as far as the design side. Thanks for your input.
JMH |
|
#11
|