We help IT Professionals succeed at work.

Unable to get images centered

rmmarsh
rmmarsh asked
on
320 Views
Last Modified: 2012-02-08
I have a site that has 2 images.  I want to place them one on top of the other, with the text to the right, as shown in the first image.  I want to do the same for the 2nd image below, but can't get my CSS to work properly.

This is my CSS:
#storeImage1  {
  float: left;
  margin-top: 50px; 
  margin-left: 50px;
 <!--  margin-bottom: 100px; 
 border: 2px solid black; -->
 }

#storeAddress1 {
  font-size: 16px;
  float: right;
  margin-top: 75px;
  margin-right: 160px;
 }

#storeImage2  {
float: left;
margin-left: 0px;
margin-top: 50px;
 <!--  margin-bottom: 100px; 
 border: 2px solid black; -->
 }

#storeAddress2 {
   font-size: 16px;
  float: right;
  margin-top: 275px;
  margin-right: 160px;
 }

Open in new window


and this is the HTML that creates the two images:

<div id="storeImage1"><img src="uploads/images/e-cigs%20store%20front%20-%20Spokane.png" alt="" width="396" height="258" /></div>
<div id="storeAddress1">
<h2><span style="text-decoration: underline;">Northside location</span><br />9301-A North Division<br /> (North of KFC)<br /> Spokane, WA 99218<br /><br /> 509-465-2695</h2>
<p> </p>
<p> </p>
</div>
<div id="storeImage2"><img src="uploads/images/e-cigs%20092_259x346.png" alt="" width="259" height="346" /></div>
<div id="storeAddress2">
<h2><span style="text-decoration: underline;">Thierman location</span><br /> 21 South Thierman<br /> (Between Sprague and Appleway) <br /><br /> 509-795-8147</h2>
</div>

Open in new window


Can someone please tell me what I'm doing wrong? (btw, I'm a newbie at CSS).

I appreciate it...
Comment
Watch Question

Data Scientist
Most Valuable Expert 2014
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Top Expert 2013
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Kyle HamiltonData Scientist
Most Valuable Expert 2014

Commented:
Cd& is probably right, but you'll be better off with the revised cleaner code anyway...
Top Expert 2013

Commented:
@miguelangelcampos,

<br clear="all" />  ???????

What is that supposed to be.  Did a new attribute get invented that I somehow missed?

It is god to see newer members posting and we encourage it, but please do not post information that is absolutely wrong and may confuse the questioner.

Cd&

Author

Commented:
Thank you all so much... I'm going to go with kozaiwaniec because learned more with the way he did it... all I have to do now is alter the margins and I should be good to go!  

BTW, I caught the "new" attribute... no harm, no foul, although I agree with the comment.

Thanks again... I really appreciate it!
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.