centre a sliced image from photoshop into dreamweaver cs4

Joined
Sep 2, 2009
Messages
3
Reaction score
0
Points
1
Please help! I have spent days on trying to figure this one out!

I have sliced an image in photoshop and opened it in dreamweaver cs4. Now im trying to centre the whole thing but there is nowhere i can do that. I have tried everything and goggled it for hours and hours.

Please please please is there anyone here that can help me out?? :'(

Thanks Anna
 
OP
A
Joined
Sep 2, 2009
Messages
3
Reaction score
0
Points
1
Mate, i wish it was that easy! Trust me i have googled this for hours without any results on how to fix this. The soutions that comes up is never for what ive done (sliced and image in photoshop and opened it in dreamweaver....maybe i have done this wrong but i dont think so...)

The problem is that i have opened my sliced image in dreamweaver....now, when i select the <div table_01> there is no where in the properties window i can align it. Not even if i select the individual slices there is an option for centring it.
If i would have built up my tables myself i would have been able to select individual tables and go to align and then centre. But there seem to be no way to do it when you open a sliced photoshop image in dreamweaver cs4.

my last solution is to type the code in myself but do not seem to be able to get it right.

So please, if anyone is clued up with this, please help me. It is really driving me nuts.

Thanks Anna
 
OP
A
Joined
Sep 2, 2009
Messages
3
Reaction score
0
Points
1
noone? any other ways i can build my sliced image up? trying with tables but it does not work since the slices are irregular!!
 
Joined
Dec 13, 2008
Messages
17
Reaction score
0
Points
1
Location
Elkhorn, Nebraska
Your Mac's Specs
MacBook Pro 2.4
At the risk of sounding like a complete idiot, please describe this thing you call 'slice'.

It sounds like you're taking an image and cutting it into pieces and want to group them as a blob, and center that..
 
Joined
Feb 9, 2007
Messages
176
Reaction score
4
Points
18
Location
So Cal
Your Mac's Specs
15 inch Macbook Pro 2 GHz Core Duo 2 GB of Ram: 20 inch iMac 2.16 GHz Core 2 Duo 3 GB Ram
If you are using div layers then u cannot use the center function to center your entire layout unless you place your entire layout into another parent div or container div. YOu wil have to use css to adjust the placement of the div layout. Not this will not center it on all screens as you will be saying the div layout is xx px from the left.
 
Joined
Oct 22, 2007
Messages
8,967
Reaction score
287
Points
83
Location
London
Your Mac's Specs
Mac Mini Core i7 2012 | White 2009 MacBook 2 Ghz | 733 Mhz G4 Quicksilver
In the CSS file you need to set up a style called body and centre that, bingo, the whole layout will be centred since that is the master tag where all the seen page content is

body {
text-align:center; /* for IE */
margin:0 auto; /* for the rest */
}
 
Joined
Sep 4, 2009
Messages
11
Reaction score
0
Points
1
Location
London
Your Mac's Specs
iMac, iPhone, iPod
I might be an idiot (I often am!) but I encountered the same trouble recently and tried this which seemed to work a dream. As gomez1018 says you will need to use a parent div to centre the whole image and then put the splices into this.....

Try:

<div style="width:100px; height:100px; position:absolute;top:50%;left:50%;margin-top:-50px;margin-left:-50px;"></div>

So: adjust the width and height to whatever the complete image you have is. Leave the top and left thingies at 50%. However, what this means is that you are asking the top left corner of the div to be bang in the centre of the browser.... not what you're wanting I think. So then the margin-top and margin-left things come in...... in the above they are at -50px as the whole image is 100 x 100 px so if they are both placed at -50px it will centre it. Obviously if your image is 250 px wide you will change that value to -175px. Once you've got that container div sorted you can insert others into it......

Hope that helps - I'm not very good at explaining but if you think it looks like the type of thing you are after let me know and I'll give you the address of a site that I did which uses this....

All the best
Bexxy
 
Joined
Dec 11, 2012
Messages
1
Reaction score
0
Points
1
Centering a slice set for the web

Hello, its 2012 and this posting is still up, so here's my input.
In Photoshop, after you've made your slices, save for web.
Then do up your preferences.
Then save, in the save panel there is a 'settings' drop down, in there choose 'other' then a window pops up 'output settings', leave the first option at 'default' but there is a second drop down window that shows 'html', on that drop down you will see setting 'slices' - use this instead of the 'html'. the menu then changes and you can see the button 'generate table'.
There it is, the spot to do it!
open your saved file in your web build program and you will see its all in a table format, so just select the table and center it, add a space or two drop the table down a bit if you want.
Seems like a lot of steps but once you know the path its pretty easy, besides, you took notes from this posting so you wouldn't forget or loose this link.

your welcome, Paul
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top