[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

reduce list image swaps

Posted on 2013-05-17
1
Medium Priority
?
278 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

649 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