Image Spacing! Help!

This is a discussion on "Image Spacing! Help!" within the Web Page Design section. This forum, and the thread "Image Spacing! Help! are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 8th, 2006, 19:35
New Member
Join Date: Aug 2006
Location: UK
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Image Spacing! Help!

I want to add a border round an image using the <div style> tag. Ive got my image as a set tag {icon} like that! So my code goes: <div style="float:left; border-style:solid; border-width:2px; border-color:black; padding-right:2px">{icon}</div>

But how can I create padding around the image without the border also lining the padding?? It creates like a white border round the image!!! I want a border round the image but to be able to pad it without the border also lining the blank padded area!!

Can this be done?? Please help!!
Reply With Quote

  #2 (permalink)  
Old Aug 8th, 2006, 19:40
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,711
Blog Entries: 1
Thanks: 0
Thanked 16 Times in 16 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: Image Spacing! Help!

<div style="float:left; border-style:solid; border-width:2px; border-color:black; padding-right:2px">{icon}</div>

The {icon} confuses me. That is for CSS not HTML. Since you are applying a style inline you don't need em. What you should do is place the CSS in the head of your document or link to an external style sheet:

<style type="text/css">
#foo {
float:left;
borde:solid 2px #000;
padding:0 2px 0 0;
}
</style>

<div id="foo">
<img src="" height="" width="" alt="" />
</div>

__________________
The internet is just a fad.
http://www.mevans76.com
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Reply With Quote
  #3 (permalink)  
Old Aug 8th, 2006, 19:45
New Member
Join Date: Aug 2006
Location: UK
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image Spacing! Help!

Quote:
Originally Posted by moojoo View Post
<div style="float:left; border-style:solid; border-width:2px; border-color:black; padding-right:2px">{icon}</div>

The {icon} confuses me. That is for CSS not HTML. Since you are applying a style inline you don't need em. What you should do is place the CSS in the head of your document or link to an external style sheet:

<style type="text/css">
#foo {
float:left;
borde:solid 2px #000;
padding:0 2px 0 0;
}
</style>

<div id="foo">
<img src="" height="" width="" alt="" />
</div>

Im inserting it into a template file for a PHP news system called FusionNews so the {icon} tag is where the users avatar will appear! It is a .php file I am editing. So I want a border round the image, then say a 2px spacing on the right around the image so that you can see the text properly!!

There is no <head> section to the page at all because its PHP. So Im guessing this cant be done then??
Reply With Quote
  #4 (permalink)  
Old Aug 8th, 2006, 19:46
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,711
Blog Entries: 1
Thanks: 0
Thanked 16 Times in 16 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: Image Spacing! Help!

It probably can, wish you specified that earlier =). is there a php include in the top of the documents pulling in a header file? You could set it there.
__________________
The internet is just a fad.
http://www.mevans76.com
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Reply With Quote
  #5 (permalink)  
Old Aug 8th, 2006, 21:06
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Image Spacing! Help!

Unless I'm missing something...

Give the div an id, lets say 'icondiv'. Now you can define a style:
Code: Select all
div#icondiv img {
   ...
}
and that style will be applied to any images that gets placed in that div.
Reply With Quote
  #6 (permalink)  
Old Aug 9th, 2006, 09:30
minute44's Avatar
Moderator
Join Date: Apr 2006
Location: Nottingham UK
Age: 24
Posts: 1,347
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to minute44
Re: Image Spacing! Help!

Quote:
Originally Posted by ukgeoff View Post
Unless I'm missing something...

Give the div an id, lets say 'icondiv'. Now you can define a style:
Code: Select all
div#icondiv img {
   ...
}
and that style will be applied to any images that gets placed in that div.
Or if it's going to repeat...Give it a class.

Code: Select all
.icondiv img {
   ...
}
Last Blog Entry: Annoying people.... (Jan 16th, 2008)
Reply With Quote
  #7 (permalink)  
Old Aug 9th, 2006, 11:59
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image Spacing! Help!

use margin
Reply With Quote
Reply

Tags
image, spacing, help

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Css Spacing Help! RZX Developer Web Page Design 5 Aug 13th, 2007 12:26
spacing issue in IE6 snooper Web Page Design 2 Jun 13th, 2007 16:16
Help needed with Spacing hbb Web Page Design 9 Jun 12th, 2007 16:22
div spacing johnnybravo Web Page Design 13 Sep 6th, 2006 12:06
spacing around images AdRock Web Page Design 4 Aug 2nd, 2006 21:32


All times are GMT. The time now is 01:18.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43