/    Sign up×
Community /Pin to ProfileBookmark

Having trouble lining up my images.

Hi, I’m having trouble lining up my images on a Website. I want them positioned under each other on the right side of the screen with a little bit of padding between them. But, what happens is that one pic will be positioned at the top on the right side, but the second pic will be below but further to the left, kind of indented, so to speak. Here’s my code.

CSS

[CODE]
img.photo1 {
height: 200px;
width: 190px;
padding-left: 4px;
padding-top: 0;
border: 0;
}
img.photo2 {
height: 200px;
width: 190px;
padding-left: 4px;
padding-top: 6px;
border: 0;
}
[/CODE]

[code=html]
<div id=”banner”>
<h1><img alt=”banner (21K)” src=”The.JPG” height=”110″ width=”825″ /></h1>
</div>

<!– pic 1 –>
<a href = “pic 045.jpg”>
<img class = “photo1” align = “right” src = “pic 045.jpg” alt = “pic 1” /></a>

<p><span style = “font-family: cursive;”>blah</span> blah blah blah blah blah blah. blah blah blah blah blah
blah blah blah blah. Blah blah blah blah blah blah blah blah blah blah blah blah blah blah.

Blah <span style = “font-family: cursive;”>Blah</span> blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah. Blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah, blah blah blah blah blah whatever I want; It will </p>

<!– pic 2 –>
<a href = ” pic 044.jpg”>
<img class = “photo2” align = “right” src = “pic 044.jpg” alt = “pic 2” /></a>

<ol type = “1”>
<li>Text.</li>
<li>text.</li>
<li>Text.</li>
<li>Text.</li>
<li>Text.</li>
<li>Text.</li>
<li>Text.</li>
<li>Text.</li>
</ol>
[/code]

Does anyone know what I’m doing wrong? I just want the two pictures to line up right under each other on the right side of the screen, but the second pic gets indented and ends up being side-by-side the 1st pic, but a few inches down from the page, not under the first pic.

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@ray326Jul 17.2005 — Have you tried float:right on the img style?
Copy linkTweet thisAlerts:
@stacywacyauthorJul 18.2005 — Thanks, I tried that but it didn't work. I had it corrected in IE, but now it's not showing correctly there either. I'll just keep trying different things.
Copy linkTweet thisAlerts:
@Wart_HogJul 18.2005 — Maybe...

[CODE]<html>
<head>
<style type="text/css">

img.photo1 {
height: 200px;
width: 190px;
padding-left: 4px;
padding-top: 0;
border: 0;
}
img.photo2 {
height: 200px;
width: 190px;
padding-left: 4px;
padding-top: 6px;
border: 0;
}
</style>
</head>
<body>
<div id="banner">
<h1><img alt="banner (21K)" src="The.JPG" height="110" width="825" /></h1>
</div>
<!-- pic 1 -->

<div style="float:left;width:610px;">
<p><span style = "font-family: cursive;">blah</span> blah blah blah blah blah blah. blah blah blah blah blah blah blah blah blah. Blah blah blah blah blah blah blah blah blah blah blah blah blah blah. Blah
<span style = "font-family: cursive;">Blah</span> blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah. Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah, blah blah blah blah blah whatever I want; It will </p>

<ol type = "1"> <li>Text.</li> <li>text.</li> <li>Text.</li> <li>Text.</li> <li>Text.</li> <li>Text.</li> <li>Text.</li> <li>Text.</li> </ol>
</div>
<div style="width:200px;margin-left:625px">
<a href = "pic 045.jpg"><img class = "photo1" src = "pic 045.jpg" alt = "pic 1" /></a>
<!-- pic 2 -->
<a href = " pic 044.jpg"> <img class = "photo2" src = "pic 044.jpg" alt = "pic 2" /></a>
</div>
</body>
</html>[/CODE]


-Mike
Copy linkTweet thisAlerts:
@stacywacyauthorJul 19.2005 — Thanks wart_hog, I hadn't thought about doing that. ?
×

Success!

Help @stacywacy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...