Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
Recent Tutorials
Top posting users this month
Top Achievers
Who is online?
In total there are 17 users online :: 0 Registered, 0 Hidden and 17 Guests :: 2 Bots
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
box-shadow glossy effects and more
Page 1 of 1 • Share
Hello Guest, I will explain how you can achieve a glossy effect with CSS using background-color and box-shadow.
Below is a blue square with text in it, our background color is set as #245A75, or:
To achieve a glossy effect we make use of box-shadow, and set it to inset so our shadow will be inside the box rather outside it. To achieve the effect in the square below, you should always use colors lighter than your background color so it will appear to have a shine.
What's great about box-shadow is that you can chain together multiple shadows in one property by using a comma! So you can have a glossy effect on top, a shadowy effect on the bottom, and a shadow on the outside of the box.
For the last shadow on the box above we used rgba, it is the same as rgb, but with an alpha filter to add opacity to our colors. This helps maintaining our colors a lot easier, especially for drop shadows.
Inset shadows are especially useful for rounded elements, in the example below you can see how different the shadows look compared to a linear object. You can round the corners using the border-radius property, to make an element a complete circle you will have to use a value that is half, or equal to that of the elements height/width.
If you have any questions, or want to share some ways you like to use box shadow feel free to leave them below. Thanks for reading!
Below is a blue square with text in it, our background color is set as #245A75, or:
- Code:
div{background-color:#245A75;}
To achieve a glossy effect we make use of box-shadow, and set it to inset so our shadow will be inside the box rather outside it. To achieve the effect in the square below, you should always use colors lighter than your background color so it will appear to have a shine.
- Code:
div{
background-color:#245A75;
box-shadow:0px 12px 6px #447A95 inset;
}
What's great about box-shadow is that you can chain together multiple shadows in one property by using a comma! So you can have a glossy effect on top, a shadowy effect on the bottom, and a shadow on the outside of the box.
- Code:
div{
background-color:#245A75;
box-shadow:0px 12px 6px #447A95 inset, 0px -10px 6px #144A65 inset, 3px 5px 6px rgba(0,0,0, 0.5);
}
For the last shadow on the box above we used rgba, it is the same as rgb, but with an alpha filter to add opacity to our colors. This helps maintaining our colors a lot easier, especially for drop shadows.
Inset shadows are especially useful for rounded elements, in the example below you can see how different the shadows look compared to a linear object. You can round the corners using the border-radius property, to make an element a complete circle you will have to use a value that is half, or equal to that of the elements height/width.
- Code:
div{
border-radius:50px;
background-color:#245A75;
box-shadow:0px 12px 6px #447A95 inset, 0px -10px 6px #144A65 inset, 3px 5px 6px rgba(0,0,0, 0.5);
}
If you have any questions, or want to share some ways you like to use box shadow feel free to leave them below. Thanks for reading!
Similar topics
Create an account or log in to leave a reply
You need to be a member in order to leave a reply.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum