Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   Web Design and Hosting (http://www.mac-forums.com/forums/web-design-hosting/)
-   -   centre a sliced image from photoshop into dreamweaver cs4 (http://www.mac-forums.com/forums/web-design-hosting/165357-centre-sliced-image-photoshop-into-dreamweaver-cs4.html)

annagr 09-02-2009 02:11 PM

centre a sliced image from photoshop into dreamweaver cs4
 
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

D3v1L80Y 09-02-2009 02:53 PM

Quote:

Originally Posted by annagr (Post 899608)
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.

Let me google that for you


and the very first result from that: Dreamweaver Tutorials - Center your layout

annagr 09-02-2009 03:03 PM

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

annagr 09-03-2009 06:14 AM

noone? any other ways i can build my sliced image up? trying with tables but it does not work since the slices are irregular!!

Scott_A 09-04-2009 01:42 PM

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..

gomez1018 09-04-2009 03:11 PM

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.

louishen 09-04-2009 03:15 PM

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 */
}

bexxy 09-04-2009 07:54 PM

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

fathom3231 12-11-2012 01:27 AM

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

RJweb 12-13-2012 07:43 PM

Post a link with the code, I could help


All times are GMT -4. The time now is 09:29 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.