Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 05:42 am EST

Geeklog Forums

Image margins?


suburbin.com

Anonymous
Hey guys. I'm fairly new to CSS, but have HTML experience.

I'm trying to add margins to my images, but nothing seems to work. I tried editing ".story-image" and ".storycontent" but still no margins.

Any idea what code I should use, and where I should stick it?

THANKS!
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
It's not that difficult, in your CSS add something like:

Text Formatted Code
img {padding: 2px; }
 

Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

SUBURBiN.com

Anonymous
Thanks for the reply.

Hm. It seemed to add a margin/padding to the logo image as well, which messed up the layout of the header.

Anybody know of a way to add padding to the story images only?

Thanks!
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Oops, sorry, try this:
Text Formatted Code
img.storytext {padding: 2px; }
 

Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

SUBURBiN.com

Anonymous
Thanks again BeeWee, but it didn't work!

That code can be put anywhere in the CSS file right?

i even tried img.story-text & img.story-content with no luck. I also tried changing it to {margin: 10px} with no luck.

Any other ideas?
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Pff, I'm no CSS expert, you could try a hspace and vspace instead of padding/margin, the place in the CSS is not important.

Good luck!
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

SUBURBiN.com

Anonymous
Yeah, I tried that too. Thanks anyway,

ANYBODY ELSE?! Shocked
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
you have only to view your page source to see if there is a class to which you can apply your style. if there is no class, then edit your template file, whichever file is responsible for the story, adding a class to the container.

the latest professional theme supplies the class ".story-box" in the TD container (storytext.thtml). Therefore,try this rule:
Text Formatted Code

TD.story-box img {
  padding: 2px;
  margin: 2px;
}
 
 Quote

Status: offline

jhk

Forum User
Chatty
Registered: 07/13/02
Posts: 57
Quote by beewee: Oops, sorry, try this:
Text Formatted Code
img.storytext {padding: 2px; }

 

That bit of CSS will only be applied to an image which has the "storytext" class.
The order should be switched:
Text Formatted Code
.storytext img {padding: 2px; }
 
This will be applied to all images which are within an object with the "storytext" class.
 Quote

All times are EST. The time is now 05:42 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content