Mike Hunt
Mike Hunt

Reputation: 37

CSS Can't move my images

I'm trying to move some images but I can't move them. I moved other images just fine but these ones won't move?

HTML: (it's a little larger with more images but i can't even move one)

<main> 
  <p class="window1"> Window 1 </p>
  <img class="uparrow1" src="images/up.png" alt="Up">
</main>

CSS:

.uparrow1 {
  position: absolute;
  top: 300px;
  left: 100px;
}

It doesn't response at any command.

Upvotes: 1

Views: 12516

Answers (2)

Emperor Krauser
Emperor Krauser

Reputation: 259

You can't move your child elements positioned in absolute if you don't set your parent element in relative.

Ex.

CSS

.parent{
  position:relative;
}

.child{
  position:absolute;
  left:100px;
}

HTML code

<div class="parent">
  <div class="child">Move me</div>
</div>

Resources for more info: http://www.w3schools.com/css/css_positioning.asp

Upvotes: 0

sol
sol

Reputation: 22959

Be sure to set the containing div to position: relative, in this case .main.

Upvotes: 1

Related Questions