Solved

reduce list image swaps

Posted on 2013-05-17
1
273 Views
Last Modified: 2013-05-17
Hi,

I have a few questions lately but I am stuck on this.
I have a few images in a list that swap image on hover. Normal code for such a list is different for a bunch of image swaps as some code doesnt work like ul li a...

I need the images to reduce in size somehow when I resize the browser.
If I can reduce the images with media queries then I will accept this.

Here is an example here. is there any point to having the links in a div and a list?

http://www.mymrt.net/ComputerTraining/test3.html

<style type="text/css">

#swap{
width:100px; height:100px;
	background-image:url(images/ic1b.png); 
  background-repeat: no-repeat; 
  display:block;
}

#swap:hover img{
	visibility:hidden;
/*	opacity:0;*/
} 

#imgswap {
	width:100px; height:100px;
	background-image:url(images/ic1b.png); 
 float:left;
margin-right:20px;
  }
  
#imgswap:hover img {
	visibility:hidden;
/*	opacity:0;*/
	} 
#imgswap2 {
	width:100px; height:100px;
	background-image:url(images/ic1b.png); 
  background-repeat: no-repeat; 
  float:left;
  margin-right:20px;
  }
  
#imgswap2:hover img {
	visibility:hidden;
/*	opacity:0;*/
	} 

#imgswap3 {
	width:100px; height:100px;
	background-image:url(images/ic1b.png); 
  background-repeat: no-repeat; 
  float:left;
  margin-right:20px;
  }
  
#imgswap3:hover img {
	visibility:hidden;
/*	opacity:0;*/
	} 
#imgswap4 {
	width:100px; height:100px;
	background-image:url(images/ic1b.png); 
  background-repeat: no-repeat; 
  float:left;
  margin-right:20px;
  }
  
#imgswap4:hover img {
	visibility:hidden;
/*	opacity:0;*/
	} 
		
	
#head {
	margin:0;
	padding:0;
	position:relative; top:100px;
	text-decoration: none;
	text-align:left;	
}
	#head ul li a
	{
	/*text-decoration: none;
	text-align:left;
	float:left;
	padding-right:10%;*/

	}	
#head ul
{
/*margin-left: 15%;*/
padding:0;

list-style-type: none;

border:none;

}	
</style>
</head>

<body>
dss
<div id="swap">
<img  src="images/ic1.png" alt=”C” />
</div>



<div id="head">
 <ul>
             <li>
<div id="imgswap"> <a href=""><img id="imgswap" src="images/ic1.png" alt=""/></a></div>
 
        
<div id="imgswap2"> <a href=""><img id="imgswap" src="images/ic1.png" alt=""/></a></div>
<div id="imgswap3"> <a href=""><img id="imgswap" src="images/ic1.png" alt=""/></a></div>
 
        
<div id="imgswap4"> <a href=""><img id="imgswap" src="images/ic1.png" alt=""/></a></div>

    </li>
          </ul>
           
</div>

</body>
</html>

Open in new window

0
Comment
Question by:jagguy
1 Comment
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 39174957
Define your widths and heights either as a percentage or use vw and vh. both of those will respond to the width and height of the page.  vw will respond to the width of the viewport, and vh will respond to the height of the viewport.

Cd&
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question