oboshto
oboshto

Reputation: 3627

Border 1px for image with border:0; without js

I have a banner with 1000px of width and 250px of height.

<a href="#">
   <img width="1000" height="250" border="0" src="http://oboshto.ru/upme/shits/banner1000.jpg" alt="">
</a>

and I can't edit the image and link code. But i can add custom code before and after banner.

How can I set 1px banner border?

Look at my jsfiddle

My code doesn't look good (look at border-bottom and border-right, but banner size is right)

Upvotes: 0

Views: 408

Answers (3)

Tutcugil
Tutcugil

Reputation: 358

http://jsfiddle.net/5JjQW/ check this code you can set with

    <div style="position: absolute;border: 1px solid #f00;width:998px; padding:2px; height:248px;">


<a href="#">  
<img width="1000" height="250" border="0" src="http://oboshto.ru/upme/shits/banner1000.jpg" alt=""></img>
</a>


</div> 

Upvotes: 0

kadam sunil
kadam sunil

Reputation: 243

This is code that i have changed use css

img { border: 1px solid #fff000; }

and code

<div style="width:998px; height:248px;">

    <!-- CAN'T EDIT THIS BLOCKS FROM -->
    <a href="#">  
        <img width="1000" height="250" border="0" src="http://oboshto.ru/upme/shits/banner1000.jpg" alt=""></img>
    </a>
    <!-- TO -->

</div> <!--  << editable -->

Upvotes: 0

jmore009
jmore009

Reputation: 12931

your border is there, the reason it's not on the right and bottom is your container has width:998px; height:248px; but your image has width="1000" height="250" either add two more pixels to your container so that the image isn't breaking out or set the container to overflow:hidden;

Upvotes: 1

Related Questions