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.
|
|
|
|
|
![]() |
||
Image Spacing! Help!
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
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!! |
|
|
|
#2
|
|||
|
|||
|
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>
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
#3
|
|||
|
|||
|
Re: Image Spacing! Help!
Quote:
There is no <head> section to the page at all because its PHP. So Im guessing this cant be done then?? |
|
#4
|
|||
|
|||
|
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.
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
#5
|
|||
|
|||
|
Re: Image Spacing! Help!
Unless I'm missing something...
Give the div an id, lets say 'icondiv'. Now you can define a style:
|
|
#6
|
||||
|
||||
|
Re: Image Spacing! Help!
Quote:
Last Blog Entry: Annoying people.... (Jan 16th, 2008)
|
|
#7
|
||||
|
||||
|
Re: Image Spacing! Help!
use margin
|
![]() |
| Tags |
| image, spacing, help |
| Thread Tools | |
|
|
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 |