2 Replies - 455 Views - Last Post: 24 January 2013 - 06:01 PM

#1 generationgen  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 14-December 12

CSS Image Align Help Please

Posted 24 January 2013 - 05:33 PM

Hello, I would really appreciate some help with my CSS coding. I am new at this :D Could someone please review www.byedui.com/inner.html I am trying to move the image of the cop and firetrucks up so it matches the top of the rounded corner div item. Could someone point me in the right direction to ensure that the image aligns exactly with the top of the div item? Thanks so much!! Cheers

Is This A Good Question/Topic? 0
  • +

Replies To: CSS Image Align Help Please

#2 e_i_pi  Icon User is offline

  • = -1
  • member icon

Reputation: 789
  • View blog
  • Posts: 1,676
  • Joined: 30-January 09

Re: CSS Image Align Help Please

Posted 24 January 2013 - 06:00 PM

The problem is more to do with your HTML than your CSS, though the whole thing is a bit of a mess.

Remove the <img> element altogether, and add the image as a background to the main div, like so:
<div align="center" id="content-container">
  <div style="width:960px;height:280px; align:right;-webkit-border-radius: 12px;-moz-border-radius: 12px;border-radius: 12px;border:1px solid #004468;background:rgba(209,209,209,0.6);background:url('images/bannere.jpg') no-repeat right;-webkit-box-shadow: #D1D1D1 2px 2px 2px;">


Was This Post Helpful? 0
  • +
  • -

#3 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3251
  • View blog
  • Posts: 10,902
  • Joined: 12-December 12

Re: CSS Image Align Help Please

Posted 24 January 2013 - 06:01 PM

You have a <div align="right"> before the image that has a height of 15px and is pushing the image down. Remove this. (I'm not sure why you need these divs any way.)

Also, the image itself is contained in a div which has no height. You are suffering from divitis!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1