Click here to Skip to main content
15,889,595 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
As i cannot attach any file here please follow my instructions to get to my issue.
1. Open your gmail account
2. Please select 'send feedback' under settings menu
3. Highlight any area using it

The highlighted section are div with raised border which gives it a 3D effect.
I am trying to create something like this but using HTML5 canvas element.Canvas methods allow us to create such rectangles but is there any way to provide such raised border 3D effect to my canvas rectangle??
Posted

If this really needs to be HTML5 canvas, all you need it to draw some lines:
http://www.tutorialspoint.com/html5/canvas_drawing_lines.htm[^].

Such frame is nothing but 4 straight line segments (at worst, 8) of a couple of different shades of color, like white and gray.

—SA
 
Share this answer
 
v3
Comments
fjdiewornncalwe 8-Jan-13 10:41am    
+5. Clean and simple.
Sergey Alexandrovich Kryukov 8-Jan-13 10:46am    
Thank you, Marcus. I'm not sure that OP needs exactly that though, it was a rather formal answer.
—SA
C#
context.rect(50, 50, 100, 100);
context.fillStyle = 'white';
context.shadowColor = 'black';
context.shadowBlur = 25;
context.shadowOffsetX = 10;
context.shadowOffsetY = 10;
context.fill();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900