6 replies [Last post]
paquito
paquito's picture
User offline. Last seen 2 years 10 weeks ago. Offline
newbie
Joined: 2010-03-09
Posts: 4
Points: 6

Hello,

When tested on IE7 (I haven't tried other versions yet) the graphic, supposed to be horizontally centered in the middle of the page, is pushed way on the right hand side. Any clue why this happens?

Page:
http://www.newtreedesign.com/lazylohans.com/

CSS:
http://www.newtreedesign.com/lazylohans.com/templates/joomlajet73/css/template.css

Many thanks
p

Hugo
Hugo's picture
User offline. Last seen 16 hours 58 min ago. Offline
rank Moderator
Moderator
Timezone: GMT+1
Joined: 2004-06-06
Posts: 15197
Points: 2300

Why are you positioning

Why are you positioning things 'Absolute' don't! Describe your wrap parent and auto centre, describe your parent div for the three graphics with a width to suit graphics and then margin auto it to centre.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

paquito
paquito's picture
User offline. Last seen 2 years 10 weeks ago. Offline
newbie
Joined: 2010-03-09
Posts: 4
Points: 6

Thanks Hugo. Could you please

Thanks Hugo.

Could you please suggest the code I need to use to do this?

The graphics are 3 main blocks + 2 slim strips as dividers.

Many thanks
p

Hugo
Hugo's picture
User offline. Last seen 16 hours 58 min ago. Offline
rank Moderator
Moderator
Timezone: GMT+1
Joined: 2004-06-06
Posts: 15197
Points: 2300

Simply remove positioning,

Simply remove positioning, you shouldn't need to be using the position property for the layout you have. You are working to set widths anyway so simply employ those widths and margins, add up the three images and their dividers total width and use that to set the width of the parent to those three images then use auto margins to centre it horizontally in it's parent.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Hugo
Hugo's picture
User offline. Last seen 16 hours 58 min ago. Offline
rank Moderator
Moderator
Timezone: GMT+1
Joined: 2004-06-06
Posts: 15197
Points: 2300

In fact can we call a halt to

In fact can we call a halt to proceedings please. We ask that people validate markup before posting for a reason. Please validate and clear up your markup errors.

IDs may only be used once amongst other issues #space has to be changed to a class.

However I strongly suggest that you get rid of those empty elements you are using, why do you need to use them? what is wrong with the correct approach to spacing which is using margins? you certainly do not need to replicate the background as a graphic for #space.

You should do something like describe a class called 'box' this holds all your rules required for all the three graphics i.e all properties that are shared, then to create the space between them simply set margins on the centre image box using it's ID, the background should then show through.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

paquito
paquito's picture
User offline. Last seen 2 years 10 weeks ago. Offline
newbie
Joined: 2010-03-09
Posts: 4
Points: 6

Thanks Hugo. The background

Thanks Hugo.

The background in #space is necessary because the red stripe at the bottom of the 3 blocks is not a whole object, but it's embed in the 3 block images. This makes necessary to have 2x 9px wide bits of graphic to show the red stripe between the 3 blocks.

Does it make sense?

Do you have by any chances a similar piece of script where I can actually see in practice what you're talking about?

p

Hugo
Hugo's picture
User offline. Last seen 16 hours 58 min ago. Offline
rank Moderator
Moderator
Timezone: GMT+1
Joined: 2004-06-06
Posts: 15197
Points: 2300

You are overcomplicating the

You are overcomplicating the layout for no real reason.

(Not sure whether the red border is meant to flow full width uninterrupted or per box as layout has changed?)

You need a new div that holds the three graphics it's this that has the width calculated from the sum of the three images and whatever margins are used. To this new div you add a border-bottom:6px solid red; or if border is per box with a space between then add the border to the bottom of the .bistro, .events {} etc

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me