Solved

resize list of images

Posted on 2013-05-15
6
264 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
  • 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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 discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now