Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

[TUT] Create Stylish Text in CSS3 - Shadow Effect (1/2)

CodingSource

The Loyalist
Advanced Member
Messages
514
Reaction score
0
Points
26
Pwede mong gawing mas maganda ang text mo sa tulong ng shadow, banner, at rotating effect gamit ang CSS3.

Kapag gusto mong magkaroon ng shadow effect ang text mo, i-consider mo kung saan mo ilalagay ito sa webpage mo. We're going to set ours above and slightly to the left. Ang formula ng shadow effect sa text ay ganito:

Code:
text-shadow: x-axis offset, y-axis offset, amount of blur, color;

Whereas sa code ang amount of blur ay optional lamang. Para mailagay natin ang shadow effect sa lower right ng text:

Code:
.shadow{
               text-shadow: 0.2em 0.2em #ccc
           }

Para paliitin natin ang shadow para mas maging realistic ang resulta, magdagdag lang tayo ng amount of blur.

Code:
.shadow{
              text-shadow: 0.2em 0.2em 0.2em #ccc
             }

Puwede na tayong maglagay ng <div> sa ating HTML webpage para ma-iapply natin doon ang shadow effect para sa text na "CodingSource tutorials"
Code:
<div id="layer">
<p class = "shadow">CodingSource tutorials</p>
</div>

At para naman sa CSS:
Code:
#layer {
     background: #900;
}
p {
    padding: 2em;
    color: #600;
    font: 3em Century Gothic;
    font-weight: 900;
}
.shadow {
   text-shadow: 0.03em 0.03em 0.03em #D00
}

Ayan, puwede mo ng i-run ang webpage sa browser mo.

Para maggawa tayo ng illusion sa 3d text na iyan (embossed, ika nga), kailangan lang natin ipagpalitin ang text at background colors, at saka yung mga side kung saan naka-focus ang lighting.

Code:
#layer {
   background: #600;
}
p {
    padding: 2em;
    color: #800;
    font: 3em Century Gothic;
    font-weight: 900;
}
.shadow {
    text-shadow: -0.03em -0.03em 0.03em #D00;
}

-----------------

Kapag gusto mo na may mas believable feeling, dapat gawin nating advantage yung kakayahan ng CSS3 na maglagay ng layer of several shadow styles.

Hindi natin kailangan pakialaman ang HTML para ma-iapplay ito. CSS lang:
Code:
.shadow {
    text-shadow: -0.01em -0.01em #D00
      -0.02em -0.02em #D00, -0.03em -0.03em
        #D00, -0.04em -0.04em #D00, -0.05em
          -0.05em #D00, -0.06em -0.06em #D00,
           -0.07em -0.07em #D00, -0.08em

Sa code natin naglagay tayo ng 8 shadpw layers where each layer is offset 0.01em from its predecessor.


Sa next part we will be focusing on rotating and banner effect.
 
Back
Top Bottom