Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-03-2010, 07:46 PM   PM User | #1
andynov123
Regular Coder

 
Join Date: Oct 2010
Posts: 246
Thanks: 8
Thanked 1 Time in 1 Post
andynov123 is an unknown quantity at this point
How to label images that you plan on moving

Hi,
Im trying to move some images on my webpage. I tried position: absolute and position: relative and used padding but my images were moving together.
Heres my HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="Level1_Arial.css" rel="stylesheet" type="text/css" />
<link href="data.css" rel="stylesheet" type="text/css" />
</head>

<body bgcolor="#006600">
<div class="movielink"><img src="movie.gif"</div>
<div class="gamelink"><img src="controller.gif"</div>
<blockquote>&nbsp;</blockquote>
</body>
</html>
My CSS

body
{
background-image:url('blackbar.jpg');
background-repeat:repeat-x;
}
.movielink {position:absolute};
.movielink {left:800px}


.gamelink
{
position:relative;
padding-left:950px;
}

Is it because Im creating div classes to identify my images???
andynov123 is offline   Reply With Quote
Old 11-03-2010, 08:18 PM   PM User | #2
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,225
Thanks: 11
Thanked 154 Times in 154 Posts
DrDOS is infamous around these parts
If you just want the images to be on a certain part of the page you don't need the divs to do that. And you're not specifying nearly enough about the divs to locate them properly. They are block level items so they extend all the way across the page unless you specify a width, for instance.
DrDOS is offline   Reply With Quote
Old 11-03-2010, 09:00 PM   PM User | #3
andynov123
Regular Coder

 
Join Date: Oct 2010
Posts: 246
Thanks: 8
Thanked 1 Time in 1 Post
andynov123 is an unknown quantity at this point
If i dont need divs then how would you identify an image that you want to move around????? What would you of done????
andynov123 is offline   Reply With Quote
Old 11-03-2010, 09:29 PM   PM User | #4
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,225
Thanks: 11
Thanked 154 Times in 154 Posts
DrDOS is infamous around these parts
Quote:
Originally Posted by andynov123 View Post
If i dont need divs then how would you identify an image that you want to move around????? What would you of done????
Just give them separate IDs, the same as you might for divs. Since the images have a natural height and width there is less you have to specify.
DrDOS is offline   Reply With Quote
Old 11-03-2010, 11:29 PM   PM User | #5
andynov123
Regular Coder

 
Join Date: Oct 2010
Posts: 246
Thanks: 8
Thanked 1 Time in 1 Post
andynov123 is an unknown quantity at this point
Do you mean like <h1 id="movielink"><img src="movielink.gif"></h1>
andynov123 is offline   Reply With Quote
Old 11-04-2010, 12:03 AM   PM User | #6
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,225
Thanks: 11
Thanked 154 Times in 154 Posts
DrDOS is infamous around these parts
Code:
<img id="movielink" src="movielink.gif" />
DrDOS is offline   Reply With Quote
Old 11-04-2010, 12:12 AM   PM User | #7
andynov123
Regular Coder

 
Join Date: Oct 2010
Posts: 246
Thanks: 8
Thanked 1 Time in 1 Post
andynov123 is an unknown quantity at this point
I can move the gamelink image but not the movielink image.
Whats wrong with my css?



body
{
background-image:url('blackbar.jpg');
background-repeat:repeat-x;
}
#movielink {position:absolute};
#movielink {left:700px}


#gamelink
{
position:absolute;
padding-left:800px;
}
andynov123 is offline   Reply With Quote
Old 11-04-2010, 12:38 AM   PM User | #8
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,225
Thanks: 11
Thanked 154 Times in 154 Posts
DrDOS is infamous around these parts
You have a spurious ; at the end of your #movielink css.
DrDOS is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:45 AM.


Advertisement
Log in to turn off these ads.