I'm having real trouble centering my website (http://www.martinaxford.co.uk), the most difficult page is the portfolio, how can I center this site so it will be centered in all browsers/screen resolutions?
I have just tried that but it hasn't worked, the other div elements didn't get inside the div container and only bits of the JS/CSS image gallery were shifted.
Any other ideas?
Many thanks, Jack
B1lancer
12-12-2008, 06:48 AM
Did I apply all tags correctly?
<html>
<head>
<title>Martin Axford Photography</title>
<META name="KEYWORDS" content="Photography, Photographs, Weddings, Martin Axford, Axford, Camera">
<meta name="author" content="Jack Royle">
<meta http-equiv="content-language" content="en">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<meta name="description" content="Photography site of Martin Axford, diverse portfolio">
<META NAME="REVISIT-AFTER" CONTENT="3 DAYS">
<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
<META NAME="RATING" CONTENT="GENERAL">
<META content="OK for Kids" name=RATING>
src="16_Sept_01_Brussels.jpg" alt="16th September 2001: Curved glass and clouds, Schaarbeek, Belgium"></li>
<li title="New Haven" style="background-image: background-repeat: no-repeat;"><img
src="18_Feb_95_Newhaven.jpg" alt="18th February 1995: Fishing on the pier at Newhaven, Sussex"></li>
<li title="Wilton Windmill" style="background-image: background-repeat: no-repeat;"><img
src="24_April_94_Wilton_Windmill.jpg" alt="24th April 1994: Wilton Windmill near Great Bedwyn, Wilts"></li>
<li title="Temple of Karnak" style="background-image: background-repeat: no-repeat;"><img
src="27th_Dec_04_Temple_of_Karnak.jpg" alt="27th December 2004: Obelisk at the Temple of Karnak, Luxor,
src="28_Sept_00_New_York.jpg" alt="28th September 2000: Reflections on 42nd Street, New York, USA"></li>
<li title="Wexford" style="background-image: background-repeat: no-repeat;"><img
alt="12th July 1997: Fishing boat in the North Sea off Esbjerg, Denmark"></li>
<li title="Loch Carron" style="background-image: background-repeat: no-repeat;"><img
src="8th_Aug_1993_Lock_Carron_Scotland.jpg" alt="8th August 1993: Loch Carron, Scotland"></li>
</ul>
</p>
</div>
</div></div>
</body>
</html>
aj_nsc
12-12-2008, 07:07 AM
The coding on your page is really not that good. I mean, you have 3 body tags. I took a look at this earlier today and after realizing that you absolutely positioned all your links and header, I decided to skip this thread. But I came back after I saw somebody responded to it, and I decided to go over your portfolio page and help you out a little bit.
Take a look at the differences between this code and yours and you should be able to figure out how to center your other pages - it won't work if you have absolutely positioned elements everywhere, but fortunately for you, it looks like you can just delete the div tags that you have absolutely positioned and it won't make a difference at all to your layout.
Also, I've only tested this in firefox because that's the only browser I could do the online editing in with the webdeveloper tool bar. I'm not sure what, if any, quirks, might pop up in IE.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Martin Axford Photography</title>
<META name="KEYWORDS" content="Photography, Photographs, Weddings, Martin Axford, Axford, Camera">
<meta name="author" content="Jack Royle">
<meta http-equiv="content-language" content="en">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<meta name="description" content="Photography site of Martin Axford, diverse portfolio">
<META NAME="REVISIT-AFTER" CONTENT="3 DAYS">
<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
<META NAME="RATING" CONTENT="GENERAL">
<META content="OK for Kids" name=RATING>
<style media="screen,projection" type="text/css">
/* general styling for this example */
* { margin: 0px; padding: 0; }
<ul id="jgal">
<li title="10th November 2007: Light and shade at Villefranche on the French Riviera." style="background-image: url(http://valvedesign.co.uk/photography/10th_Nov_07_Villefranche.jpg); background-repeat: no-repeat;" class="active"><img src="10th_Nov_07_Villefranche.jpg" alt="10th November 2007: Light and shade at Villefranche on the French Riviera."></li>
<li title="24th August 1997: Broad Hinton from the Ridgeway on the Marlborough Downs." style="background-image: url(http://valvedesign.co.uk/photography/24_Aug_97_Broad_Hinton2.jpg); background-repeat: no-repeat;"><img src="24_Aug_97_Broad_Hinton2.jpg" alt="24th August 1997: Broad Hinton from the Ridgeway on the Marlborough Downs."></li>
<li title="16th September 2001: Curved glass and clouds, Schaarbeek, Belgium" style="background-image: url(http://valvedesign.co.uk/photography/16_Sept_01_Brussels.jpg); background-repeat: no-repeat;"><img src="16_Sept_01_Brussels.jpg" alt="16th September 2001: Curved glass and clouds, Schaarbeek, Belgium"></li>
<li title="18th February 1995: Fishing on the pier at Newhaven, Sussex" style="background-image: url(http://valvedesign.co.uk/photography/18_Feb_95_Newhaven.jpg); background-repeat: no-repeat;"><img src="18_Feb_95_Newhaven.jpg" alt="18th February 1995: Fishing on the pier at Newhaven, Sussex"></li>
<li title="24th April 1994: Wilton Windmill near Great Bedwyn, Wilts" style="background-image: url(http://valvedesign.co.uk/photography/24_April_94_Wilton_Windmill.jpg); background-repeat: no-repeat;"><img src="24_April_94_Wilton_Windmill.jpg" alt="24th April 1994: Wilton Windmill near Great Bedwyn, Wilts"></li>
<li title="27th December 2004: Obelisk at the Temple of Karnak, Luxor, Egypt" style="background-image: url(http://valvedesign.co.uk/photography/27th_Dec_04_Temple_of_Karnak.jpg); background-repeat: no-repeat;"><img src="27th_Dec_04_Temple_of_Karnak.jpg" alt="27th December 2004: Obelisk at the Temple of Karnak, Luxor, Egypt"></li>
<li title="28th September 2000: Reflections on 42nd Street, New York, USA" style="background-image: url(http://valvedesign.co.uk/photography/28_Sept_00_New_York.jpg); background-repeat: no-repeat;"><img src="28_Sept_00_New_York.jpg" alt="28th September 2000: Reflections on 42nd Street, New York, USA"></li>
<li title="16th April 1994: Culture Street, Wexford, Ireland" style="background-image: url(http://valvedesign.co.uk/photography/G119_16th_Apr_1994_Wexford.jpg); background-repeat: no-repeat;"><img src="G119_16th_Apr_1994_Wexford.jpg" alt="16th April 1994: Culture Street, Wexford, Ireland"></li>
<li title="12th July 1997: Fishing boat in the North Sea off Esbjerg, Denmark" style="background-image: url(http://valvedesign.co.uk/photography/12_July_97_Esbjerg.jpg); background-repeat: no-repeat;"><img src="12_July_97_Esbjerg.jpg" alt="12th July 1997: Fishing boat in the North Sea off Esbjerg, Denmark"></li>
<li title="8th August 1993: Loch Carron, Scotland" style="background-image: url(http://valvedesign.co.uk/photography/8th_Aug_1993_Lock_Carron_Scotland.jpg); background-repeat: no-repeat;"><img src="8th_Aug_1993_Lock_Carron_Scotland.jpg" alt="8th August 1993: Loch Carron, Scotland"></li>
</ul>
</div>
</body>
</html>
I think you might want to have a look at some tutorials on how to make HTML pages, and use CSS to style them.
People on this forum help each other out when they come across a problem they can't fix, they don't teach people web design from scratch, and it certainly looks like you may need a primer or two in it.
EDIT: I screwed up a part of the code, I placed a <ul where there shouldn't have been one. It's fixed now, sorry about that, it might cause some problems for you if you copy and paste it and wonder why it isn't working.
B1lancer
12-12-2008, 07:19 AM
Cheers for the help, I know my code isn't very good, I'm a graphic artist which is where my skills are however I like to try and put together sites using some of my graphics (in this instance I am trying to help out a mate who knows even less than I do about HTML!) but they often end up a bit of a mish-mash of code, a frankenstein of a site!
I think the main image displayed by the CSS generated gallery is abosolute, so I will have to have a bit of a play with that me thinks.
Kindest regards, Jack
Fang
12-12-2008, 08:50 AM
This will center the site, but I would advise against using frames; they will cause problems with referencing and search engines amongst other things:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">