Borders

B

Bruno

I have the following code in my page and want the images to be surrounded by
a 150 x 150 border despite the size of each image. What have I done wrong?

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
..imgsmall {
border: 2px solid #656051;
margin: 10px;
text-align: center;
background-color: #FFFFFF;
width: 150px;
height: 150px;
}

..imgnav {
position: absolute;
left: 32%;
top: 130px;
}
</style>
</head>

<body>
<div class="imgnav">
<div class="imgsmall"><a href="design_red_dress.php"><img
src="images/rtw_ladies.jpg" alt="Click here to see a larger image and
description." /></a></div><div class="imgsmall"><a
href="design_trouser_suit.php"><img src="images/rtw_mens.jpg" alt="Click
here to see a larger image and description."/></a></div>
</div>
</body>
</html>
 
E

Els

Bruno said:
I have the following code in my page and want the images to be surrounded by
a 150 x 150 border despite the size of each image. What have I done wrong?

Nothing. The alt text is just longer than 150px, so when you
put in the pics, the alt text won't show anymore, and the
problem will be solved.
Well, that's if your images aren't larger than 146 x 146px.
 
J

Jukka K. Korpela

Bruno said:
I have the following code in my page and want the images to be
surrounded by a 150 x 150 border despite the size of each image.

What do you mean by 150 x 150 border? Do you actually mean putting each
image inside a 150 by 150 pixels box?
What have I done wrong?

To begin with, you didn't post a URL. Why should we try and construct a
test page, instead of looking at yours?
<div class="imgsmall"><a href="design_red_dress.php"><img
src="images/rtw_ladies.jpg" alt="Click here to see a larger image
and description." /></a></div><div class="imgsmall"><a
href="design_trouser_suit.php"><img src="images/rtw_mens.jpg"
alt="Click here to see a larger image and description."/></a></div>

Those alt texts will act as _replacements_ of the images exactly how?
 
B

Bruno

Els said:
wrong?

Nothing. The alt text is just longer than 150px, so when you
put in the pics, the alt text won't show anymore, and the
problem will be solved.
Well, that's if your images aren't larger than 146 x 146px.

Thanks Els. It works fine now.
 
B

Bruno

Els said:
wrong?

Nothing. The alt text is just longer than 150px, so when you
put in the pics, the alt text won't show anymore, and the
problem will be solved.
Well, that's if your images aren't larger than 146 x 146px.

Actually it fails to work when I change the style to display: inline. Is
this usual?
 
E

Els

[snip code]
Actually it fails to work when I change the style to display: inline. Is
this usual?

Inline elements don't have widths as far as I know. But why
do you set display:inline to the divs? I guess you wanted to
display them horizontally, and have them take up the
available width of the window. What you need is float:left
instead of display:inline.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top