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-7-05. : 1:14 am]
l)ark_ssj9kevin -- Rectal!!!
[2026-7-05. : 12:13 am]
IskatuMesk -- u guys ever look at the "Backend performance improvements" line and kinda you know 👀
[2026-7-03. : 4:25 pm]
l)ark_ssj9kevin -- oh wow it's kind of like archipeligo but solo
[2026-7-03. : 9:43 am]
Oh_Man -- makes me wonder tho, a brood war achievement project culd be quite something, following the design methodology of SC2 achieves
[2026-7-03. : 9:43 am]
Oh_Man -- intresting concept, i see starcraft N64 is on there, most of the achieves seen bare bones though
[2026-7-03. : 9:43 am]
Oh_Man -- https://retroachievements.org/ i stumbled across this website
[2026-7-02. : 9:57 pm]
IskatuMesk -- :wob:
[2026-7-02. : 10:46 am]
UndeadStar -- :wob:
[2026-7-01. : 3:34 pm]
Symmetry -- :wob:
[2026-7-01. : 4:42 am]
Zycorax -- :wob:
Please log in to shout.


Members Online: Roy