473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

unwanted vertical margins on horizonatally stacked images

Hello web experts, a question form a lonely beginner in HTML and CSS crying out for help!!,

I am trying to stack 5 images of the same dimensions next to each other horizontally as the top bar of my website. I am adding them separately as they will move around from page to page, and will also be links.

I have floated the 5 images left, and they have white margins vertically where the edges of the images meet when i want them to sit flush.

This is the div in my HTML:
Expand|Select|Wrap|Line Numbers
  1. <div id="top_banner">
  2. <a href="alligator.html"><img src="images/top_alligator_02.jpg" alt="alligator thumbnail" title="alligator_thumbnail" /></a>
  3. <a href="excalibur.html"><img src="images/top_excalibur_03.jpg" alt="excalibur thumbnail" title="excalibur_thumbnail"/></a>
  4. <a href="fabrication.html"><img src="images/top_fabrication_04.jpg" title="fabrication_thumbnail" alt="fabrication thumbnail"/></a>
  5. <a href="minigator.html"><img src="images/top_minigator_05.jpg" title="minigator_thumbnail" alt="minigator thumbnail"/></a>
  6. <a href="balmoral.html"><img src="images/top_balmoral_06.jpg" title="balmoral_thumbnail" alt="balmoral thumbnail"/></a>
  7.  
  8. <a href="index.html"><img src="images/hl_logo_07.gif" title="henry lewis logo" alt="henry lewis logo"/></a>
  9. </div>
  10.  
  11. and my CSS is 
  12.  
  13. #top_banner {
  14.     margin: 0px;
  15.     border: 0px;
  16.     padding: 0px;
  17. }
  18.  
- so i have tried to turn off all ways of having the margins but still get space between the images - aaarrrrrrrrrrrgggggghhhhh!!.

Does anyone have any other suggestions?

Thank you sooooooo much for your time :)
Oct 13 '08 #1
2 2469
David Laakso
397 Expert 256MB
Target the element that determines how a picture is displayed.
Expand|Select|Wrap|Line Numbers
  1. <img>
  2.  
CSS
Expand|Select|Wrap|Line Numbers
  1. img {
  2. border:none;
  3. float:left;
  4. width:150px;
  5. height:150px;
  6. }
  7.  
No CSS is needed (so far, anyway) for the parent container.
Expand|Select|Wrap|Line Numbers
  1. #top_banner { }
  2.  
Some versions of IE need the height and width stated in the markup or the image may not appear; or, it will appear but may be distorted.
Expand|Select|Wrap|Line Numbers
  1. <img src="images/hl_logo_07.gif" width="155" height="155" alt="" />
  2.  
Make sure the document has a doctype and that the markup and the CSS are valid.

PS Please enclose your html and CSS in code tags when posting to the forum. Thanks.
Oct 13 '08 #2
clain
79
you can try an over flow hidden property for the parent div ... this will fix the problems,,,, enjoy coding--
Dec 2 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Aaron | last post by:
Hi, In the following code, everything looks fine on Explorer, but on Netscape there is a large white gap between the 'top' section and the 'bottom menu' section. I've set the style 'div img...
3
by: Frank Wheeler | last post by:
Why am I unable to attain proper vertical alignment between a DIV and a TABLE here: http://www.whbvillage.com/agenda-archives/agendex.html The DIV is coded: <DIV style="float: left;...
5
by: Applebrown | last post by:
Hello, basically, I'm just learning intermediate CSS and trying to convert my old table webpage completely to CSS. Hoorah, right? Well, it's not quite going as planned. It's an extremely simple...
5
by: Geoff Hague | last post by:
(posted to both alt.html and c.i.w.a.s. as I'm not sure what, exactly, is at fault here) I'm doing a site re-design: http://www.captainsoftheworld.com/cotw/index.html...
16
by: Uncle Pirate | last post by:
This has me stumped. I am trying to use as little space as possible at the top of my document but Firefox/Mozilla insists on placing vertical space before any element. IE displays it correctly...
10
by: John Baker | last post by:
Hi: I have a user who has labels that are set up 3 across and 11 vertical (which is unusual at best), and he wants me to print names and addresses on them. I have already set up for labels 10...
13
by: Egil Helland | last post by:
I am trying to create a breadcrumb with both icons and text, looking like: Home > Trail > Trail Now, how on earth do I get the images and text to vertically align so that the vertical...
15
by: scott | last post by:
Hello, I'm working on updating some of my table-based sites to use CSS instead of tables. One of my sites has a header that is composed of three elements: A B C In my prior design, this was...
1
by: Edward | last post by:
I created a simple CSS layout (code and example below) for bloggin/writing but ran into five issues that I need help with: 1. How do I get rid of the right-margin red line on the last three...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.