...

View Full Version : Can't figure out this code



Debra2006
05-21-2007, 08:31 AM
Hello everyone! I am new to html and know nothing about it. I was wondering if someone could help me out with a web page I am trying to build. I found this layout on the link posted below and would very much like it to be like the sample layout they provide above the background tiles. Exact same colors. So I downloaded the background tiles to my computer and then loaded them into my server. But what I need help with is how do I get it to even out with my screen when someone opens it? Like changing size, etc. I created a practice page to play with this and when i saved it and published the backgrounds didn't show up. Just the the coding layout. Can someone please help me out in getting this to work. Please go lightly on me and remember I know nothing about html. I feel silly for asking these questions but really want this page to work. Any help would be greatly appreciated.


http://www.pircnet.com/mixnmatch/index.html

Here is the coding:

<html>
<head>
<title>Title of Your Page</title>
</head>
<body background="tile-012-b.jpg">
<br>
<p><center><table width="90%" cellpadding=40 cellspacing=0 border=1 background="tile-012-c.jpg">
<tr>
<td width="100%">
<p><center><table width="100%" border=1 background="tile-012-a.jpg">
<tr>
<td width="100%">Your Content Goes Here
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
</center>
</body></html>


And here are the background tiles I saved to my computer.

tile-012-b.jpg (this being the very last background)
tile-012-c.jpg (this one being the middle background)
tile-012-a.jpg (and this one being the top background)

What am I doing wrong? Please help!

Thanks,
Debra

_Aerospace_Eng_
05-21-2007, 08:49 AM
You have the right idea except you are going about it the wrong way. Since you are new I think its better for you to start off the right way. Tables are NOT meant for page layout. You may want to read the link in my sig about tables. Now on to your layout. Try this.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Title of Your Page</title>
<style type="text/css">
html, body {
margin:0; /*this sets default margin to 0*/
padding:0; /*this sets default padding to 0, mainly for Opera*/
background:url(tile-012-b.jpg); /*sets background for whole page*/
font-size:0.9em; /*this sets the font size to 0.9em, all browsers will be able to resize text*/
font-family:Verdana, Arial, Helvetica, sans-serif; /*this sets the font for the whole page, browser will go to next font if previous font can't be found*/
}
body {
padding:40px; /*this creates the 40px padding on each side of document*/
}
#container {
width:90%; /*this is the width of the flowery div*/
margin:auto; /*this allows you to center this div at all times no matter what the users resolution is*/
background:url(tile-012-c.jpg); /*this sets the background image of <div id="container"></div>*/
padding:40px 0; /*this sets a top and bottom padding of 40px, we don't want it on the left or right because the overall width will increase*/
}
#main {
width:90%; /*this is 90% the width of <div id="container"></div>*/
margin:auto;
background:url(tile-012-a.jpg)
}
#main p {
margin:0; /*this sets the margins on all paragraphs in <div id="main"></div> to 0*/
padding:10px; /*this sets a 10px padding on all paragraphs in <div id="main"></div> to 0*/
text-align:justify;
}
</style>
</head>
<body>
<div id="container">
<div id="main">
<p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In non felis. Sed pretium tempor dui. Donec nec quam nec justo viverra luctus. Donec dolor libero, aliquam cursus, rutrum eget, ornare in, purus. Pellentesque interdum fermentum elit. Quisque sed purus. Nullam commodo arcu quis ante. Morbi volutpat urna non quam. Suspendisse lacus magna, rhoncus non, semper non, vehicula vulputate, velit. Vivamus elit. Aliquam purus lacus, hendrerit sit amet, pulvinar id, pulvinar sed, neque. Ut tellus. </p>
<p> Mauris ligula. Nullam felis nibh, varius nec, euismod at, ullamcorper vel, eros. Proin a ligula. Curabitur scelerisque. Curabitur tristique. In in metus lacinia odio volutpat ultrices. Cras nonummy vestibulum erat. Duis sem libero, vehicula ac, blandit non, condimentum ut, mauris. Suspendisse potenti. Curabitur luctus risus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Duis pretium ligula. Sed enim justo, lacinia eget, malesuada sit amet, convallis sit amet, arcu. Nullam vitae dolor. Cras tristique elit in sapien tempus interdum. Praesent augue. Etiam tempus aliquet ante. Mauris porttitor lacus. Nulla et pede et arcu laoreet porttitor. </p>
<p> Ut vel arcu nec turpis porta fermentum. Donec magna. Duis condimentum justo sed pede. Phasellus suscipit pharetra magna. Fusce pretium. Sed sagittis tincidunt mi. In auctor tortor. In lacinia odio at purus. Aenean lorem lorem, aliquam fermentum, dapibus id, nonummy tempor, libero. Donec eget ante. Nullam et turpis. Nulla imperdiet urna at pede cursus ornare. Vivamus in nisl eu nunc volutpat iaculis. Donec et felis vitae massa interdum ultricies. Mauris dui nulla, fermentum vel, pulvinar ac, luctus varius, metus. Pellentesque luctus. </p>
</div>
</div>
</body>
</html>

smalldog
05-21-2007, 09:06 AM
Hi Debra, give me the URL of your server and I will tell you why your backgrounds didn't show up.

Debra2006
05-22-2007, 05:20 AM
Hi there, I am currently using Homestead. I just tried saving and publishing with the code _Aerospace_Eng_ provided for me and it didn't work either. The backgrounds show up when I preview it but not when published. I didn't realize how hard all this stuff could be. It looked simple off that website by just placing that code and loading those background tiles. :o

I sure hope to get this figured out. :thumbsup:

Thanks,
Debra

_Aerospace_Eng_
05-22-2007, 06:51 AM
You can still give us a link to your site. The images may not be where you think they are.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum