HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 3rd, 2007, 09:49 AM
STeeL STeeL is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 23 STeeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 41 m 7 sec
Reputation Power: 0
Remove white space between pictures

My code goes like this:

Code:
<span><img src="image1.jpg"></span>
<span><img src="image2.jpg"></span>
<span><img src="image3.jpg"></span>


If I write this code in one line I'm fine. But when I have them in separate line like above, I end up having white space between them. How do I get rid of them?

Reply With Quote
  #2  
Old March 4th, 2007, 08:02 AM
Corey Bryant Corey Bryant is offline
Texan at Heart
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Castle Rock, CO
Posts: 316 Corey Bryant User rank is Sergeant (500 - 2000 Reputation Level)Corey Bryant User rank is Sergeant (500 - 2000 Reputation Level)Corey Bryant User rank is Sergeant (500 - 2000 Reputation Level)Corey Bryant User rank is Sergeant (500 - 2000 Reputation Level)Corey Bryant User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 15 h 6 m 54 sec
Reputation Power: 19
Chances are you might be viewing it in Internet Explorer and seeing white space it added. Plus I am not sure what styles you have applied to the span? You might try
Code:
<span><img src="image1.jpg"></span><span><img src="image2.jpg"></span><span><img src="image3.jpg"></span>
to see if that helps

Reply With Quote
  #3  
Old March 5th, 2007, 09:15 AM
Tukaro's Avatar
Tukaro Tukaro is offline
Standing 3 feet to the left.
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jan 2006
Location: USA
Posts: 1,435 Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level)Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level)Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level)Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level)Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level)Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level)Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level)Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 3 h 49 m 16 sec
Reputation Power: 184
Send a message via AIM to Tukaro Send a message via MSN to Tukaro
The space is caused because the browser interrepts the tab/return between them to be a space. You might be able to keep it all on separate lines by setting the margin and padding to 0, though I think the space will still be in there.

Reply With Quote
  #4  
Old March 5th, 2007, 10:05 AM
b3n's Avatar
b3n b3n is offline
Prisoner of the Sun
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jul 2004
Location: The Mews At Windsor Heights
Posts: 5,309 b3n User rank is General 21st Grade (Above 100000 Reputation Level)b3n User rank is General 21st Grade (Above 100000 Reputation Level)b3n User rank is General 21st Grade (Above 100000 Reputation Level)b3n User rank is General 21st Grade (Above 100000 Reputation Level)b3n User rank is General 21st Grade (Above 100000 Reputation Level)b3n User rank is General 21st Grade (Above 100000 Reputation Level)b3n User rank is General 21st Grade (Above 100000 Reputation Level)b3n User rank is General 21st Grade (Above 100000 Reputation Level)b3n User rank is General 21st Grade (Above 100000 Reputation Level)b3n User rank is General 21st Grade (Above 100000 Reputation Level)b3n User rank is General 21st Grade (Above 100000 Reputation Level)b3n User rank is General 21st Grade (Above 100000 Reputation Level)b3n User rank is General 21st Grade (Above 100000 Reputation Level)b3n User rank is General 21st Grade (Above 100000 Reputation Level)b3n User rank is General 21st Grade (Above 100000 Reputation Level)b3n User rank is General 21st Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 4 Days 8 h 2 m 23 sec
Reputation Power: 2349
Facebook Orkut
White space DOES matter. Different browsers treat white space differently. It's best to write everything on 1 line if possible, with no needless spaces or newlines. Although it does make your code harder to read - you have to get the balance right. Generally inline elements are more affected by white space.

One example is <a> tags - they should never contain any newlines:
<a href="url.com"><img src="img1.gif" /></a>
__________________
.
:: My blip.fm tunes :: Web Design Feeds :: Web Dev Feeds :: CheatSheets :: PHP :: MySQL :: 13 Moon FB App.

"All matter is merely energy condensed to a slow vibration. We are all one consciousness experiencing itself - subjectively. There is no such thing as death, life is only a dream. We are the imaginations of ourselves."
- Bill Hicks


"Truth is hidden in the subtle nature of the heart of everything, although it is invisible. One cannot see it from inside and neither from the surface. One can only live and experience it."
- Heart Sutra

Reply With Quote
  #5  
Old March 5th, 2007, 11:21 AM
Tukaro's Avatar
Tukaro Tukaro is offline
Standing 3 feet to the left.
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jan 2006
Location: USA
Posts: 1,435 Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level)Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level)Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level)Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level)Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level)Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level)Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level)Tukaro User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 3 h 49 m 16 sec
Reputation Power: 184
Send a message via AIM to Tukaro Send a message via MSN to Tukaro
If you still want to keep all the images on their own line, you can "comment out" the returns:
html4strict Code:
Original - html4strict Code
  1. <span><img src="image1.jpg"></span><!--
  2. --><span><img src="image2.jpg"></span><!--
  3. --><span><img src="image3.jpg"></span>
It's a really nasty way and kind of abuses the comment tag, but I believe that will take care of the spaces between the images while making the document a bit easier to read.

Reply With Quote
  #6  
Old April 23rd, 2008, 01:12 PM
monotreme's Avatar
monotreme monotreme is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2003
Location: Oregon
Posts: 933 monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level)monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level)monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level)monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level)monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level)monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level)monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level)monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 6 Days 14 h 47 m 30 sec
Reputation Power: 115
Send a message via Yahoo to monotreme
Cool. Yeah it's a hack but whatever.
__________________
Nothing says CLUELESS NOOB quite as poignantly as $q = "SELECT * FROM users WHERE id = " . $_GET[id];

Reply With Quote
  #7  
Old April 23rd, 2008, 01:33 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Dev Shed God 30th Plane (19500 - 19999 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 19,835 Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level) 
Time spent in forums: 6 Months 1 Day 22 h 11 m
Reputation Power: 4192
I don't like adding extra X/HTML comments. I prefer doing something like this:
Code:
<span><img src="image1.jpg"></span><span
><img src="image2.jpg"></span><span
><img src="image3.jpg"></span>
__________________
Spreading knowledge, one newbie at a time. I'm available for hire at Dynamic Site Solutions.

Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

Remember people spend most of their time on other people's sites (so don't violate web design conventions).

Reply With Quote
  #8  
Old April 23rd, 2008, 01:48 PM
monotreme's Avatar
monotreme monotreme is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2003
Location: Oregon
Posts: 933 monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level)monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level)monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level)monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level)monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level)monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level)monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level)monotreme User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 6 Days 14 h 47 m 30 sec
Reputation Power: 115
Send a message via Yahoo to monotreme
At some geeky level that IS better.

Indeed. Comments can get icky. Thanks
Quote:
Originally Posted by Kravvitz
I don't like adding extra X/HTML comments. I prefer doing something like this:
Code:
<span><img src="image1.jpg"></span><span
><img src="image2.jpg"></span><span
><img src="image3.jpg"></span>

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Remove white space between pictures

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap