/    Sign up×
Community /Pin to ProfileBookmark

Double border for images

Greetings,

I have an image on a html page where I would like to have a double border around the image. I know how to do one border obviously, but I would like the 2nd border around the 1st border with a different colour. can this be done?

Thanks

DP

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@WebJoelSep 03.2008 — <img src="#" [B]style="border:3px double gray" [/B]/>

Since you want "double", you need to state a width of "3px" else the two pixel width would not show and 'gap' in between the two one-pixel borders...

This is called "[B]inline-style[/B]" CSS ?

With a different color, can't be done yet.

But you could put the image inside of a 'fluid' division ("div")

<div style="padding:2px; border:1px solid green;width:104px; height:104px;">

<img src="#" style="width:100px; height:100px; border:1px double blue;" />

</div>

A little unwieldy, but it works.
Copy linkTweet thisAlerts:
@dennicauthorSep 03.2008 — thank you very much for the reply. just to confirm, will the line below (<img src="#" style="border:3px double gray" />) incorporate two different colours? How would i do this? I would like white on the inside and grey on the outside.

thanks again.
Copy linkTweet thisAlerts:
@WebJoelSep 03.2008 — thank you very much for the reply. just to confirm, will the line below (<img src="#" style="border:3px double gray" />) incorporate two different colours? How would i do this? I would like white on the inside and grey on the outside.

thanks again.[/QUOTE]

No, because the stated color (read "single" stated color), is "gray". No white, just 'the stated color'. To do TWO colors, you need to invoke a 'container' with a border, padding, and insert the border-image within.

You can try other variants of "border" like

<img src="#" style="width:400px; height:500px; [B]border:14px groove green;"[/B] />[/QUOTE] Note that this produces the 'framed picture' effect...

Here, "green" is combined with a browser-assigned default 'border color' probably black or dark gray, along with the stated "green".

I stated "14px" as the width to make this as visually stunning as possible.

"groove" (and "double") are "border-style" attributes, which are as follows:


[INDENT][B]none [/B] Defines [I]no border[/I]

[B]hidden [/B] The same as "none", except in border conflict resolution for table

[B]dotted [/B] Defines a dotted border

[B]dashed [/B] Defines a dashed border

[B]solid[/B] Defines a solid border

[B]double [/B] Defines two borders. The width of the two borders are the same as the border-width value

[B]groove[/B] Defines a 3D grooved border. The effect depends on the border-color value

[B]ridge[/B] Defines a 3D ridged border. The effect depends on the border-color value

[B]inset[/B] Defines a 3D inset border. The effect depends on the border-color value

[B]outset[/B] Defines a 3D outset border. [/INDENT]
×

Success!

Help @dennic spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...