Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 22, 2012, 10:19 PM   #1
larswik
macrumors 65816
 
Join Date: Sep 2006
HTML Centering images

I'm not much of an HTML programmer and do most of it real simple in Dreamweaver. When I have an image I center it with <p style="text-align:center">

This time I created a PS file and sliced it up in to smaller parts. Now in Dreamweaver I am trying to figure out where to add the code. Can some one help me identify the area and the correct code if it is different

Code:
</head>
<body bgcolor="#000000" style="background-color:#FFFFFF; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;">
<!-- Save for Web Slices (New front page.psd) -->
<div id="Table_01">
	<div id="index-01">
		<img src="images/index_01.png" width="273" height="468" alt="">
	</div>
	<div id="index-02">
		<img src="images/index_02.png" width="146" height="468" alt="">
	</div>
	<div id="index-03">
		<img src="images/index_03.png" width="52" height="468" alt="">
	</div>
	<div id="index-04">
		<img src="images/index_04.png" width="136" height="468" alt="">
	</div>
	<div id="index-05">
		<img src="images/index_05.png" width="303" height="468" alt="">
	</div>
	<div id="index-06">
		<img src="images/index_06.png" width="273" height="26" alt="">
	</div>
	<div id="index-07">
		<img src="images/index_07.png" width="146" height="26" alt="">
	</div>
	<div id="index-08">
		<img src="images/index_08.png" width="52" height="26" alt="">
	</div>
	<div id="index-09">
		<img src="images/index_09.png" width="136" height="26" alt="">
	</div>
	<div id="index-10">
		<img src="images/index_10.png" width="303" height="26" alt="">
	</div>
	<div id="index-11">
		<img src="images/index_11.png" width="273" height="22" alt="">
	</div>
	<div id="index-12">
		<img src="images/index_12.png" width="146" height="22" alt="">
	</div>
	<div id="index-13">
		<img src="images/index_13.png" width="52" height="22" alt="">
	</div>
	<div id="index-14">
		<img src="images/index_14.png" width="136" height="22" alt="">
	</div>
	<div id="index-15">
		<img src="images/index_15.png" width="303" height="22" alt="">
	</div>
</div>
<!-- End Save for Web Slices -->
</body>
</html>
__________________
I know more than yesterday.
Lars
larswik is offline   0 Reply With Quote
Old May 23, 2012, 04:29 AM   #2
mif
macrumors Demi-God
 
Join Date: Feb 2010
Location: home
After <div ?

<div style="text-align: center;" id="index-01">
<div style="text-align: center;" id="index-02">
__________________
"Every day, in every way, i am feeling better and better" - Dreyfus
mif is offline   0 Reply With Quote
Old May 23, 2012, 10:55 AM   #3
vandersmissenc
macrumors newbie
 
Join Date: Sep 2011
Location: Houston, TX
need to see it

I would need to actually see this to understand what you want to center, but if you are trying to center everything then change this

Code:
<div id="Table_01">
to include auto margins

Code:
<div id="Table_01" style="margin: 0 auto;">
that will center that div between the left and right of the page and there will be no space at the top. That should accomplish what you are trying to do, but if you can give us a link to preview it we could be of more help. Right now it is nothing more than a bunch of divs referencing images.
__________________
2009 Mac Pro 2.66 GHz Quad-Core, 16GB Ram, 640 GB & 160 GB HDD, XFX HD6870 1GB;
vandersmissenc is offline   0 Reply With Quote
Old May 23, 2012, 07:28 PM   #4
larswik
Thread Starter
macrumors 65816
 
Join Date: Sep 2006
Hey , thanks for the response and sorry for the delay in getting back. I know little about HTML but I know C and Objective C for the most part. I thought I could help my friend get her new site up and running. I created it in PhotoShop and sliced it up and exported out as HTML with Images. I made a change in the settings for CSS.

Here is the splash page for her site.

http://sparrowheatley.com/

I am going to try and use the code you provided tonight and try to get all the iamges to be centered. I have no desire to learn HTML right now since I am hard at work with objective C. I thought Dreamweaver would have made this easier.

Thanks for the help.
__________________
I know more than yesterday.
Lars
larswik is offline   0 Reply With Quote
Old May 23, 2012, 11:33 PM   #5
vandersmissenc
macrumors newbie
 
Join Date: Sep 2011
Location: Houston, TX
thanks

Thanks for posting the splash page, this will center it for you:

Code:
<div id="Table_01" style="margin: 0 auto;position:relative;">
__________________
2009 Mac Pro 2.66 GHz Quad-Core, 16GB Ram, 640 GB & 160 GB HDD, XFX HD6870 1GB;
vandersmissenc is offline   0 Reply With Quote
Old May 24, 2012, 01:47 AM   #6
larswik
Thread Starter
macrumors 65816
 
Join Date: Sep 2006
Yep, it did. Thank you very much for the help!

-Lars
__________________
I know more than yesterday.
Lars
larswik is offline   1 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
All iPads: HTML Coders... Display Retina Images 1:1 on IPad ? OSMac iPad 0 Nov 8, 2013 04:17 PM
Need help with inserting Images in Wordpress(basic html question) Arkados Web Design and Development 7 Aug 4, 2013 02:01 AM
Issue with HTML Signature images in Mail 6.5 Devision Mac Applications and Mac App Store 1 Jun 14, 2013 08:48 AM
Resolved: Safari can't load images/javascript/html 5 on certain website. Traisoon OS X 1 Nov 23, 2012 08:31 AM

Forum Jump

All times are GMT -5. The time now is 05:59 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC