473,686 Members | 2,233 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Vertical white space in between images where I don't want it

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 layout, and I'm finding myself
stuck with small white space in between my images where I planned for the
graphics to be stacked up right on top of one another.

Here's the simple vertical layout: width is 640px, centered with a CSS
border. I'd basically like absolutely no space in between all these
elements.

[logo image (about 300px), centered]
[navbar top image, centered, 7px high] - a horizontal navbar
[navbar link images, 3 of 'em with 2 separator images between, all centered,
45px high]
[navbar bottom bar image, centered, 7px high, identical to top image]
[content, right under that with no space]
[footer]

My main problem is that there's a few seemingly random px worth of white
space in between my navbar lines, each in their own <div>. Even when I
specify a margin: 0; padding: 0; for my images or the <div>, there's still
that space and they are not stacking vertically without the space.

What is a simple way to stack these images on top of one another without
absolute positioning? I'm just learning about absolute and relative
positioning btw.

Thanks


Jul 20 '05 #1
5 12344
Applebrown wrote in
<YRQuc.636673$I g.371568@pd7tw2 no>
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 layout, and
I'm finding myself stuck with small white space in between my images
where I planned for the graphics to be stacked up right on top of one
another.

Here's the simple vertical layout: width is 640px, centered with a CSS
border. I'd basically like absolutely no space in between all these
elements.

[logo image (about 300px), centered]
[navbar top image, centered, 7px high] - a horizontal navbar
[navbar link images, 3 of 'em with 2 separator images between, all
centered, 45px high]
[navbar bottom bar image, centered, 7px high, identical to top image]
[content, right under that with no space]
[footer]

My main problem is that there's a few seemingly random px worth of
white space in between my navbar lines, each in their own <div>. Even
when I specify a margin: 0; padding: 0; for my images or the <div>,
there's still that space and they are not stacking vertically without
the space.

What is a simple way to stack these images on top of one another
without absolute positioning? I'm just learning about absolute and
relative positioning btw.

It's easier with a URL but have you tried removing any line breaks between
images? The break is interpreted as a space by the browser.

<img...><img... > - no white space

<img...>
<img...> - produces a line of white space between the images.
--
PeterMcC
If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.

Jul 20 '05 #2
Thanks for the response.

I found out later by searching a CSS forum that IE has a default line-height
of 16px. Therefore, each of my 7px high navbars had 9px extra of white
space. When I added:

line-height: 1px;
font-size: 1px;

to the navbar rules, they all matched up perfectly. That's something that I
probably wouldn't have guessed easily...
"PeterMcC" <pe***@mccourt. org.uk> wrote in message
news:40bc4000$0 $27217$ed2619ec @ptn-nntp-

It's easier with a URL but have you tried removing any line breaks between
images? The break is interpreted as a space by the browser.

<img...><img... > - no white space

<img...>
<img...> - produces a line of white space between the images.
--
PeterMcC
If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.

Jul 20 '05 #3
"Applebrown " <ap********@gam ebanshee.taketh is.andthisout.c om> wrote:
Thanks for the response.
Not top posting would be the best way to thank the regulars. ;-)
I found out later by searching a CSS forum that IE has a default line-height
of 16px.


No it doesn't. IE has a factory default font-size of 16px, the
line-height will be somewhat larger than that (about 18 or 19px).

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net > <http://steve.pugh.net/>
Jul 20 '05 #4

"Steve Pugh" <st***@pugh.net > wrote in message
news:4d******** *************** *********@4ax.c om...
"Applebrown " <ap********@gam ebanshee.taketh is.andthisout.c om> wrote:
Thanks for the response.
Not top posting would be the best way to thank the regulars. ;-)


Deal.
I found out later by searching a CSS forum that IE has a default line-heightof 16px.


No it doesn't. IE has a factory default font-size of 16px, the
line-height will be somewhat larger than that (about 18 or 19px).
Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net > <http://steve.pugh.net/>

Jul 20 '05 #5
"Applebrown " <ap********@gam ebanshee.taketh is.andthisout.c om> wrote:
Not top posting would be the best way to thank the regulars. ;-)


Deal.


Trimming quotes is an essential part of bottom posting.

--
Spartanicus
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

45
3478
by: Stephen Poley | last post by:
People in these groups, and on web-pages, not infrequently suggest that it is worthwhile cutting down on white-space and comments in HTML and CSS in order to reduce loading times. I and others have more than once doubted this, given the data-compression in the HTTP protocol. Having seen it suggested again a couple of times in the last few days, I decided it was time for a test on the effect of white-space. I took one of my pages:...
10
66031
by: Markus Ernst | last post by:
Hi I have a strange problem with vertical-align. The case can be viewed at http://www.brainput.info/geschichte.html. HTML code: <div id="bild"><img src="geschichte.gif" width="274" height="29" alt="Wir schreiben die Geschichte Ihres Unternehmens."></div>
16
9256
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 (as I want). At one point, I set some negative top margins which moved the graphics above the page in IE. Here's the link: http://abateofnm.org/ I've tried reformatting the HTML to assure there is no white space and I've tried setting top...
13
2699
by: Harlan Messinger | last post by:
What rules deal with attribute values with trailing spaces, or tags or attribute values with embedded newlines? Examples below: the HREF with embedded newline, the SRC with trailing spaces, and IMG tag spread over multiple lines. <a href="myself.html "> <img src="/images/picture.gif " width="80" height="65" alt="What, me worry?"></a>
4
1503
by: Nathan Sokalski | last post by:
I have two asp:ImageMaps in a table cell as follows: <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="center"> <asp:ImageMap ID="mapBanner" runat="server" BorderWidth="0px" Height="82px" ImageUrl="../images/top_banner.jpg" Width="1000px" style="margin:0px;padding:0px;"> <asp:RectangleHotSpot Left="125" Top="5" Right="200" Bottom="22"
1
6159
by: dave8421 | last post by:
Hi, I have a (strict) html document with the following portion: <ul> <li><img alt="" src="images/image1.jpg" /></li> <li><img alt="" src="images/image2.jpg" /></li> <li><img alt="" src="images/image3.jpg" /></li> <li><img alt="" src="images/image4.jpg" /></li> <li><img alt="" src="images/image5.jpg" /></li>
3
5378
by: lolo | last post by:
hello. happy new year. I'm trying to build a website for my wife and she is adament on having a horizontal thumbnail scrolling div. great. I have a good vertical scrolling thing, but can't figure out how to make it scroll horizontally. It's probably real simple and I just can't figure it out.... Here is the code I have so far:
0
2213
by: joeriatscripts | last post by:
The example: Example. And the code again down this post. There is a vertical gap (assumable 3px) between the MENU & CONTENT and MENU & HEADER. The layout shows perfectly in IE7 / FF2 etc. Just IE6 remains a problem. So I am stuck... Been reading about the 3px problem, but somehow this does not work for me, as I am NOT using <P> or any images either. Also tried to set a negative margin or padding, does not work either. Any help is...
2
2490
by: FairyLucy | last post by:
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. ...
0
8586
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8520
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8936
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7603
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5800
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2953
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.