Staredit Network > Forums > Technology & Computers > Topic: HTML/CSS website help
HTML/CSS website help
Aug 28 2009, 9:58 pm
By: sharf  

Aug 28 2009, 9:58 pm sharf Post #1



Ok, so the idea for my page is to have two images on either side of the content of the page. These images shouldn't repeat, and should be fixed when you scroll. To accomplish this I've got two table cells on either side of the content, and have the tables having background images, that are not repeated, and fixed. It works. The problem is, when I set them to be fixed, the right cell, with the right border, is pushed way off center. As soon as I turn off the fixed position, it centers right.

Here's my code:
Quote
<title>Untitled Document</title>
<style type="text/css">
<!--
html, body, #body, #background1, #background2 {
height:100%;
margin: 0;
padding: 0;
border: none;
}
#body {
margin: 0 auto;
text-align: left;
}
#background1 {
background-image: url(leftguy.png);
background-repeat: no-repeat;
position: fixed;
}
#background2 {
background-image: url(rightguy.png);
background-repeat: no-repeat;
position: fixed;
}
a:link {
color: #009966;
}
a:visited {
color: #00CC33;
}
body {
background-color: #000000;
}
-->
</style></head>

<body>
<table width="800" height="475" border="0" align="center" cellpadding="0" cellspacing="0" id="body">
<tr>
<td width="140" valign="top" id="background1"> </td>
<td><p> </p>
</td>
<td width="140" valign="top" id="background2"> </td>
</tr>
</table>
</body>
</html>
Thanks, sharf



None.

Aug 28 2009, 10:05 pm Jack Post #2

>be faceless void >mfw I have no face

I have code on my other comp that makes a stationary background image, that stays when you scroll. Is that what you want?



Red classic.

"In short, their absurdities are so extreme that it is painful even to quote them."

Aug 28 2009, 10:07 pm sharf Post #3



the trick is the background is not in the body, like a page background. That's simple. What I need, is a background for a particular cell, to be stationary when you scroll. I have accomplished that. But in doing so, the table is pushed off center. However when I take out the postion: fixed; from the CSS, it re aligns properly, IE and FF both have this issue, and I can't figure out why.

And uppon messing with settings trying to get something, it turns out that any text or content in the main cell, between the two side images, are left aligned to the whole page, not the cell, so they are way off from where they should be...hmm....

Post has been edited 1 time(s), last time on Aug 28 2009, 10:15 pm by sharf.



None.

Aug 28 2009, 10:19 pm Jack Post #4

>be faceless void >mfw I have no face

I don't know enough then sorry.



Red classic.

"In short, their absurdities are so extreme that it is painful even to quote them."

Aug 29 2009, 7:17 am Syphon Post #5



Do not use tables for this.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2026-6-01. : 4:03 pm]
IskatuMesk -- no Hello World? No Hello . jpeg? Not even ddosing some government website? smh my head
[2026-5-31. : 10:02 pm]
Symmetry -- I was really just figuring out how to compile
[2026-5-31. : 10:02 pm]
Symmetry -- I didn't make it do anything
[2026-5-31. : 9:17 pm]
Ultraviolet -- hell yeah. did you have trouble making the button functional, or just haven't gotten there yet?
[2026-5-31. : 8:29 pm]
Symmetry -- I made the marine shoot lasers and gave the medic a nonfunctional button
[2026-5-31. : 8:07 pm]
Ultraviolet -- Symmetry
Symmetry shouted: I did my first EUD thing today. Feels like me finding arsenal at age 8 again
haha for sure. in some ways it's even more exciting because you can play EUD maps on regular battle.net, don't need to convince someone to download your mod to play with you. what did you do?
[2026-5-31. : 6:47 pm]
Symmetry -- I did my first EUD thing today. Feels like me finding arsenal at age 8 again
[2026-5-31. : 3:20 pm]
l)ark_ssj9kevin -- le reddit
[2026-5-31. : 2:55 pm]
Moose -- >reddit :rip2:
[2026-5-31. : 2:07 pm]
IskatuMesk -- reddit 💀
Please log in to shout.


Members Online: Excalibur