corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » n00b HTML Help please


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author n00b HTML Help please
Doug
Member

Registered: 8th Oct 03
User status: Offline
22nd Nov 08 at 15:43   View User's Profile U2U Member Reply With Quote

I am designing a webpage, there is a background image that is set to repeat-x so that it covers the entire background regardless of screen size.

The layout of the webpage is that of a white square which I need to center both horizontally and vertically within the page so that it displays correctly on all monitors.

I am sure its a simple line of code or could be done through the use of a style sheet but I cant remember how to do it as last time I wrote CSS stuff was 3 years ago



So as you can see I need to get the white area centered.

Is it 'float' or something?
Doug
Member

Registered: 8th Oct 03
User status: Offline
22nd Nov 08 at 15:46   View User's Profile U2U Member Reply With Quote

Can I use the align="absmiddle" command in dreamweaver?
Doug
Member

Registered: 8th Oct 03
User status: Offline
22nd Nov 08 at 16:37   View User's Profile U2U Member Reply With Quote

<body>
<style>
img.mycenter {margin-left:auto; margin-right:auto; display:block; text-align:center;}
</style>

<img class="mycenter" src="Main.png" height="600" width="800">

</body>

I have got it centered now using that code.

What would I need to change in that code to get it to sit equally from top and bottom like it is doing from the right and left?
Brett
Premium Member

Avatar

Registered: 16th Dec 02
Location: Manchester
User status: Offline
22nd Nov 08 at 16:46   View Garage View User's Profile U2U Member Reply With Quote

I'd just do...

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle"><img src="main.png" /></td>
</tr>
</table>
Doug
Member

Registered: 8th Oct 03
User status: Offline
22nd Nov 08 at 16:59   View User's Profile U2U Member Reply With Quote

Top bombing

Cheers bruv
Doug
Member

Registered: 8th Oct 03
User status: Offline
26th Nov 08 at 17:31   View User's Profile U2U Member Reply With Quote

Right I have a problem....

Using the following code gets that image to float in the center perfectly but when I start adding some slices in fireworks and export the HTML file I am struggling to get it to work

Code to get the image to float centrally:
code:
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle"><div align="center"><img src="Main.png">
</div>
</td>
</tr>
</table>


New page code that I need to get to float centrally instead of just the plain image:



code:
<table border="0" cellpadding="0" cellspacing="0" width="800"> <!-- fwtable fwsrc="home.png" fwpage="Page 1" fwbase="home.png" fwstyle="Dreamweaver" fwdocid = "1542789007" fwnested="0" -->
<tr>
<td>
<img src="images/spacer.gif" width="79" height="1" border="0" alt="" />
</td>
<td>
<img src="images/spacer.gif" width="163" height="1" border="0" alt="" />
</td>
<td>
<img src="images/spacer.gif" width="50" height="1" border="0" alt="" />
</td>
<td>
<img src="images/spacer.gif" width="39" height="1" border="0" alt="" />
</td>
<td>
<img src="images/spacer.gif" width="28" height="1" border="0" alt="" />
</td>
<td>
<img src="images/spacer.gif" width="143" height="1" border="0" alt="" />
</td>
<td>
<img src="images/spacer.gif" width="61" height="1" border="0" alt="" />
</td>
<td>
<img src="images/spacer.gif" width="91" height="1" border="0" alt="" />
</td>
<td>
<img src="images/spacer.gif" width="63" height="1" border="0" alt="" />
</td>
<td>
<img src="images/spacer.gif" width="83" height="1" border="0" alt="" />
</td>
<td>
<img src="images/spacer.gif" width="1" height="1" border="0" alt="" />
</td>
</tr>
<tr>
<td colspan="10"><img name="home_r1_c1" src="images/home_r1_c1.png" width="800" height="50" border="0" id="home_r1_c1" alt="" />
</td>
<td>
<img src="images/spacer.gif" width="1" height="50" border="0" alt="" />
</td>
</tr>
<tr>
<td rowspan="4"><img name="home_r2_c1" src="images/home_r2_c1.png" width="79" height="550" border="0" id="home_r2_c1" alt="" />
</td>
<td colspan="3"><a href="home.htm"><img name="home_r2_c2" src="images/home_r2_c2.png" width="252" height="38" border="0" id="home_r2_c2" alt="" /></a>
</td>
<td rowspan="2" colspan="6"><img name="home_r2_c5" src="images/home_r2_c5.png" width="469" height="478" border="0" id="home_r2_c5" alt="" />
</td>
<td><img src="images/spacer.gif" width="1" height="38" border="0" alt="" />
</td>
</tr>
<tr>
<td colspan="3"><img name="home_r3_c2" src="images/home_r3_c2.png" width="252" height="440" border="0" id="home_r3_c2" alt="" />
</td>
<td><img src="images/spacer.gif" width="1" height="440" border="0" alt="" />
</td>
</tr>
<tr>
<td rowspan="2"><img name="home_r4_c2" src="images/home_r4_c2.png" width="163" height="72" border="0" id="home_r4_c2" alt="" /></td> <td><a href="home.htm"><img name="home_r4_c3" src="images/home_r4_c3.png" width="50" height="21" border="0" id="home_r4_c3" alt="" /></a></td> <td colspan="2"><a href="welcome.htm"><img name="home_r4_c4" src="images/home_r4_c4.png" width="67" height="21" border="0" id="home_r4_c4" alt="" /></a></td> <td><a href="acquired.htm"><img name="home_r4_c6" src="images/home_r4_c6.png" width="143" height="21" border="0" id="home_r4_c6" alt="" /></a></td> <td><a href="therapy.htm"><img name="home_r4_c7" src="images/home_r4_c7.png" width="61" height="21" border="0" id="home_r4_c7" alt="" /></a></td> <td><a href="medicolegal.htm"><img name="home_r4_c8" src="images/home_r4_c8.png" width="91" height="21" border="0" id="home_r4_c8" alt="" /></a></td> <td><a href="contact.htm"><img name="home_r4_c9" src="images/home_r4_c9.png" width="63" height="21" border="0" id="home_r4_c9" alt="" /></a></td> <td rowspan="2"><img name="home_r4_c10" src="images/home_r4_c10.png" width="83" height="72" border="0" id="home_r4_c10" alt="" /></td> <td><img src="images/spacer.gif" width="1" height="21" border="0" alt="" /></td> </tr> <tr> <td colspan="7"><img name="home_r5_c3" src="images/home_r5_c3.png" width="475" height="51" border="0" id="home_r5_c3" alt="" /></td> <td><img src="images/spacer.gif" width="1" height="51" border="0" alt="" /></td> </tr> </table>


Does anyone have any suggestions?



[Edited on 26-11-2008 by Doug]

[Edited on 27-11-2008 by Doug]
Laney
Member

Registered: 6th May 03
Location: Leeds
User status: Offline
26th Nov 08 at 18:18   View User's Profile U2U Member Reply With Quote

Use

margin: 0 auto;
width: whateverpx;

On nested divs. Theres examples out there!
Doug
Member

Registered: 8th Oct 03
User status: Offline
26th Nov 08 at 21:04   View User's Profile U2U Member Reply With Quote

Could you give me an example of the code I need?

I am getting abit stuck here
Doug
Member

Registered: 8th Oct 03
User status: Offline
27th Nov 08 at 10:17   View User's Profile U2U Member Reply With Quote

TTT for today, see if anyone can help me

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
Some website help please? madboutcars Geek Day 29 2579
11th May 03 at 17:11
by madboutcars
 
DONNY CORSA PICS > more pics added Thoday General Chat 22 375
19th Apr 04 at 21:39
by XTC113
 
4-4-2 Mag's Top 100 Players... Cosmo Sports Day 54 1417
28th Sep 07 at 14:19
by Cosmo
 
Making Virgin Media Wireless dannymccann Geek Day 11 746
15th Aug 08 at 10:32
by dannymccann
 

Corsa Sport » Message Board » Off Day » Geek Day » n00b HTML Help please 29 database queries in 0.0143561 seconds