Solved

resize list of images

Posted on 2013-05-15
6
267 Views
Last Modified: 2013-05-17
Hi,
I have a list of images with spaces between each.
can I get them to resize when I reduce browser size?
I would like the images to be smaller and the spaces between them to sqeeze up.
#headingIconList ul
{
margin: 0;


list-style-type: none;

border:none;

}

#headingIconList ul li 
{
     display: inline;

 }

#headingIconList ul li a
{
text-decoration: none;
padding-right:  10%;



 
}//////////////////////////////
......................
  <ul>
             <li>
             
                 <a href=""><img  src="../images/ic1.png" alt="head"/></a>
                 <a href=""><img  src="../images/ic1.png" alt="head"/></a>
                 <a href=""><img  src="../images/ic1.png" alt="head"/></a>
                 <a href=""><img  src="../images/ic1.png" alt="head"/></a>
              
             </li>
          </ul>

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
  • 3
  • 3
6 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39170337
Typically when you are using media queries to detect browser size you will have multiple sizes of your images and load as needed.

Although not optimal, you can set the size by changing the width and height in your css

ul li img{width:80%; height:80%;}
0
 

Author Comment

by:jagguy
ID: 39170377
Yes I know media queries but with images they resize automatically as the browser reduces in size
Here is an example here of a heading with an image.
See how it resizes.
http://www.mymrt.net/ComputerTraining/home.html

I cant do this for a list of images as links

img, embed, object, video {

  max-width: 100%;
   
}

Open in new window

0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39170403
seems to work fine http://jsbin.com/itixel/1/

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
  <style>
    img{

  max-width: 100%;
   
}
  </style>
</head>
<body>
 
    <ul>
             <li>
             
                 <a href=""><img  src="http://www.nuvo.net/binary/76d4/beerbuzz600.jpeg"/></a>
                 <a href=""><img  src="../images/ic1.png" alt="head"/></a>
                 <a href=""><img  src="../images/ic1.png" alt="head"/></a>
                 <a href=""><img  src="../images/ic1.png" alt="head"/></a>
              
             </li>
          </ul>
</body>
</html>

Open in new window

0
Independent Software Vendors: 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!

 

Author Comment

by:jagguy
ID: 39170869
excellent images !
here is the issue , if the images are small like 100X100 and they are all in a row, the dont resize like the larger images and they drop down to the next line.

This resizes image to 80% of the screen in a media query.
ul li img{
		width:80%; height:80%;
		} 

Open in new window

0
 

Author Comment

by:jagguy
ID: 39171158
When I resize my webpage, the row of 4 images in the heading dont resize and they go on another line.
I just want the images to reduce in size as the browser reduces.

Here is what I am talking about

http://www.mymrt.net/ComputerTraining/comptest.html
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39171557
Working Sample  http://jsbin.com/uqevuk/1/ or http://jsbin.com/uqevuk/1/edit

You will need to tweek the css but this gets you in the right direction.  

Updated css
 #headingIconList{
   /* ---   ignore ------
		text-align:left;
		position:relative; top:22%;left:15%;
   */
	   }
 #headingIconList  img{
         margin-left:1%;
         margin-right:1% ;
         width:20%;		

	   }

/* ---   ignore ------
#headingIconList ul li 
{
     display: block;

 }

#headingIconList ul li a
{
text-decoration: none;
padding-right:  10%;


}
*/

Open in new window

Updated HTML
<div id="headingIconList">
         
                 <a href=""><img  src="http://www.mymrt.net/ComputerTraining/images/ic1.png" alt="head2"/></a>
                  <a href=""><img  src="http://www.mymrt.net/ComputerTraining/images/ic1.png" alt="head2"/></a> 
                  <a href=""><img  src="http://www.mymrt.net/ComputerTraining/images/ic1.png" alt="head2"/></a>
                 <a href=""><img  src="http://www.mymrt.net/ComputerTraining/images/ic1.png" alt="head2"/></a>
          
           
        	</div><!--headingIconList-->

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

735 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