PDA

View Full Version : Centering images


jim_thomsen
11-15-2011, 11:41 PM
I am a beginner and have been using dreamweaver in design mode with one of the templates, but now I am trying to create a new site. I have it set as 3 column fixed. See: www.vanuatutravels.com (http://www.vanuatutravels.com/) Once I have the right page setup we will use design view to insert text and pictures.
In the #Main Content section the pictures stay left justified, even when I format for right or center. Currently the code is:
<p align="center"><img src="images/Tanna/DSC_6344.jpg" width="150" height="99" /></p>

In another column, #sidebar 2 it seems the code is the same and the pictures can be centered or right or left.
<p align="center"><img src="images/Tanna/men wear traditional lava lavas at the circumcision ceremony in Lounabeknai, Tanna.jpg" width="350" height="246" /></p>

Looking at the CSS definitions they seem to be the same, with text justified on both. But the sidebar works fine and the main does not. Sorry for what is probably a very beginner question. Obviously I am missing something!

BullDog
11-16-2011, 01:02 AM
I see:

<p><img src="images/Tanna/DSC_6344.jpg (http://www.dreamweaverclub.com/forum/view-source:http://www.vanuatutravels.com/images/Tanna/DSC_6344.jpg)" width="150" height="99" /></p>

Change it to:

<p align="center"><img src="images/Tanna/DSC_6344.jpg (http://www.dreamweaverclub.com/forum/view-source:http://www.vanuatutravels.com/images/Tanna/DSC_6344.jpg)" width="150" height="99" /></p>

DWcourse
11-16-2011, 03:41 AM
<p align="center">

CSS will overrule HTML attributes such as align which is what's happening here. In fact the use of the HTML attribute align is no longer considered good practice.

You'll need to add a CSS class with the text-align:center property and apply that to the paragraphs containing the images you want to center.

BullDog
11-16-2011, 03:46 AM
thank you. I based that on how he centered the others. feel free to delete my post.

domedia
11-16-2011, 05:07 AM
thank you. I based that on how he centered the others. feel free to delete my post.

We don't delete posts Bulldog, the more people that want to contribute, the merrier :) This is a good example of how there can be more than one answer to a problem.

jim_thomsen
11-16-2011, 08:16 AM
Thank you DWcourse!
I’m sorry, but I am afraid I am a little slow…
You said:


You'll need to add a CSS class with the text-align:center property and apply that to the paragraphs containing the images you want to center.



Here is what I currently have for the CSS for the main content. How can I add something that just applies to the paragraphs containing images?
( Again. I am sorry if these are basic questions I should already understand… my excuse? I’m just an old guy traveling the world by sailboat and trying to learn dreamweaver …I guess I do need a course.)

.thrColFixHdr #mainContent {
width: 450px;
margin-top: 0;
margin-right: 100px;
margin-bottom: 0;
margin-left: 100px;
padding-top: 0;
padding-right: 0px;
padding-bottom: 0;
padding-left: 10px;
background-color: #000;
color: #CCC;
text-align: justify;
border-top-color: #000;
border-right-color: #000;
border-bottom-color: #000;
border-left-color: #000;
left: 20px;
right: 20px;
}

Corrosive
11-16-2011, 08:40 AM
my excuse? Iím just an old guy traveling the world by sailboat and trying to learn dreamweaver

Wow, what a way to learn! I am very jealous indeed :mrgreen:

jim_thomsen
11-16-2011, 09:00 AM
It's a fun way to learn....but a little slow (that is why I am asking so many questions now.) I just spent 4 months in Vanuatu with no internet connection. But now that I can read the news again...wow, I didn't miss much!

jim_thomsen
11-16-2011, 09:26 AM
Yes, a wonderful life. But not easy to learn new programs. I have been in Vanuatu for the past few months without internet access. But then again, I don't think I missed the news that much.