homepage Welcome to WebmasterWorld Guest from 54.226.235.222
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
expanding link bar through magnifying icons
how to get a row of link icons to expand both left and right
bonnybroome




msg:4292125
 12:59 am on Apr 5, 2011 (gmt 0)

I want link icons/images to 'magnify' when the cursor goes over them, (get slightly larger).I can do this by swapping in a larger version of the icon, I know how to do that.
The issue is that I want for the entire row to move a bit to the right AND a bit to the left, when that happens. If I just swap in a larger picture then the icons to the right of the moused-over one will move to the right slightly to make room, but the left ones won't move at all.

So I need to create a line of images that are centered in a div, like text that is centered in a div,
but images instead. So I need a whole set of images that are floating as a centered set of images?
Does anyone know if this is possible?

here is some html,
I didn't include the code for swapping in the larger icons, don't need that. just curious how to format the div that holds the link icon/images

<!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>test</title>
<style type="text/css">
#lower{width:800px;
height:80px;
margin-left:auto;
margin-right:auto;

}
#icons { width:461px;
margin-left:auto;
margin-right:auto;
}
</style>
</head>
<body>

<div id="lower">
<div id="icons">
<img src="images/shelfdezign.gif" />
<img src="images/carpentry.gif"/>
<img src="images/quilt.gif"/>
<img src="images/spiral.gif" />
<img src="images/writing.gif"/>
<img src="images/photo.gif"/>
<img src="images/me.gif" />

</div>
</div>


</body>
</html>

 

birdbrain




msg:4292327
 10:02 am on Apr 5, 2011 (gmt 0)

Hi there bonnybroome,

and a warm welcome to these forums. ;)

I don't really see what your problem is. :(

In the following example the images stay centered on hover...


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<base href="http://www.webmasterworld.com/gfx/">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">

<title>images hover test</title>

<style type="text/css">
body {
background-color:#f0f0f0;
}
#container {
width:550px;
margin:20px auto;
border:1px solid #666;
background-color:#fcfcfc;
}
#icons {
text-align:center;
}
#icons img {
width:50px;
height:50px;
border:1px solid #999;
cursor:pointer;
}
#icons img:hover {
width:200px;
height:200px;
}
#bar {
width:400px;
height:5px;
background-color: #966;
margin:auto;
}
#bar1 {
width:550px;
height:5px;
background-color: #966;
margin-top:-3px;
}
</style>

</head>
<body>

<div id="container">

<div id="bar"></div>

<div id="icons">
<img src="logo.png" alt="">
<img src="logo.png" alt="">
<img src="logo.png" alt="">
<img src="logo.png" alt="">
<img src="logo.png" alt="">
<img src="logo.png" alt="">
<img src="logo.png" alt="">
</div>

<div id="bar1"></div>

</div>

</body>
</html>

birdbrain

bonnybroome




msg:4292367
 11:45 am on Apr 5, 2011 (gmt 0)

Thank you, birdbrain, very much for responding. This was my first ever post on a forum. I didn't realize that text-align:center would work for images, didn't even try it until you suggested it and it works fine. I also assumed that when I created a div I had to set dimensions for it, that a div is always a sized bounding box. Thanks.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved