4 replies [Last post]
Needahand
Needahand's picture
User offline. Last seen 1 year 47 weeks ago. Offline
newbie
Timezone: GMT+1
Joined: 2010-03-14
Posts: 3
Points: 4

Hi all,
I am a bit of a beginner to CSS and am trying to solve what I would have thought was a simple problem. I am trying to put 3 images horizontally across a page, one image aligned left, one image aligned right, and the other to appear centrally between the other 2. I have tried several things but nothing seems to work. Help would be much appreciated.
Needahand

Needahand
Needahand's picture
User offline. Last seen 1 year 47 weeks ago. Offline
newbie
Timezone: GMT+1
Joined: 2010-03-14
Posts: 3
Points: 4

Dreamweaver

Ps I am using Dreamweaver CS4 so need to know how to create new class style to achieve this.

Hugo
Hugo's picture
User offline. Last seen 8 hours 6 min ago. Offline
rank Moderator
Moderator
Joined: 2004-06-06
Posts: 15096
Points: 2191

Using DW is not something we

Using DW is not something we can or will be prepared to help you with, the best advice there is not to get too bogged down with it's interface, any of the areas where it tries to do things for you or provide helpful shortcuts. CSS and markup is really a hand coding exercise, knowing how to write a class as an attribute of an element or as a CSS selector is straightforward enough and something you ought to learn to do without any help from DW, that we can help you with although if you really are not sure it might be best to run through beginners tutorials at somewhere like htmldog.

As for the question we do generally ask that people post code, both CSS and Markup or a link to the page live. You state "tried several things" statements like that must be qualified as they are meaningless to us what have you tried it might be pertinent to the question asked?

There are many ways things like this can be achieved but what which one chooses is often determined by the existing markup.

Based on what you ask the best any of could do is provide generic approaches to doing this but without any notion of whether that will work or is best approach.

I could say: float two images, one left and one right in a parent element with fixed width, the third simply give auto margins and ensure it's declared block level and follows last in the source markup after the first two. might work all depends! There will be otgher ways to do this.

Show us the markup and styles you have presently please.

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

Needahand
Needahand's picture
User offline. Last seen 1 year 47 weeks ago. Offline
newbie
Timezone: GMT+1
Joined: 2010-03-14
Posts: 3
Points: 4

Centre Images

Hi,
Thanks for the reply, sorry didn't realise you didn't advise on Dreamweaver. I tried what you suggested, putting centred image after left and right floated images, applying style as a block (text centred) and left and right margins set to auto, but I get the same result as previously with the image not properly centred.

This is my test page:

http://www.needahandspanishproperties.com/test2.html

Hope you can help.

Hugo
Hugo's picture
User offline. Last seen 8 hours 6 min ago. Offline
rank Moderator
Moderator
Joined: 2004-06-06
Posts: 15096
Points: 2191

Yes but you HAVEN'T done what

Yes but you HAVEN'T done what I stated so I now have to repeat my self *sigh* Smile

*deep breath*

display:block; essential on the center image as it's NOT floated and MARGINS!!!!! what is left:auto;? it aint no margin is it? margin-left and margin-right or margin:0 auto;

Do the above and it will work but check cross browser.

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