Solved

How can i hide image border or make it ignore image padding?

Posted on 2008-10-07
2
1,149 Views
Last Modified: 2012-05-05
Hello,

I want to add a little padding around my images so that they are seperated from the text in my infowindows.

At present the only viewable image can be seen by clicking on the Norwich (SE England) pushpin marker, followed by the green arrow and then the round icon.

I have tried marking my image up as follows:
<img style="float: left; padding: 0px 10px 8px 0px";" src="/travel_pics/72/Toby Texas Chainsaw Massacre.jpg" width="100" height="100" alt="Highslide JS" title="Click to enlarge"/>

...but as you can see, this doesn't work because the Javascript uses a border which is defined at the top of my script.

How can i get round this, while still making use of the Javascript border (essentially the effect i'm looking for is what happens when you hover the mouse over the image!) ?


Many thanks
0
Comment
Question by:Daniish
2 Comments
 
LVL 5

Accepted Solution

by:
MMeijer earned 500 total points
Comment Utility
padding is for inside container elements, too which <img /> does not qualify, but 'margin:0px 10px 8px 0px' will do.
0
 
LVL 6

Expert Comment

by:ixti
Comment Utility
MMeijer is giving you a right point.

Also you may set it via CSS
so add somewhere inside <head></head> block:

<style type="text/css">
    .img_preview { margin:0px 10px 8px 0px }
</style>

another hook is to place image inside block element, such as:

<div><img ... /></div>

So you'll be able to do something like this:

<div style="border: solid 1px black; padding: 0px 10px 8px 0px"><img ... /></div>
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now