شما اینجا هستید

تغییر شکلهای CSS3 به ما توانایی تغییر موقعیت، چرخاندن، تغییر سایز و کج کردن عناصر را میدهد.

تغییر شکل افکتی است که از طریق آن میتوان شکل ظاهری، اندازه و موقعیت یک عنصر را تغییر داد.

CSS3 هم از تغییر شکلهای 2 بعدی و هم از تغییر شکلهای 3 بعدی پشتیبانی میکند.

در این درس در مورد روشهای تغییر شکل 2 بعدی زیر خواهید آموخت:

  • ()translate
  • ()rotate
  • ()scale
  • ()skewX
  • ()skewY
  • ()matrix

تغییر شکل های 3 بعدی را در درس بعدی آموزش میدهیم.

روش ()translate

روش ()translate باعث حرکت یک عنصر بر طبق پارامترهایی که برای محور x و محور y گرفته است از جای فعلی میشود.

مثال زیر عنصر <div> را از مکان فعلی 50 پیکسل به راست و 100 پیکسل به پایین میبرد:

<html>

<head>

<style>

div {

    width: 300px;

    height: 100px;

    background-color: yellow;

    border: 1px solid black;

    transform: translate(50px,100px);

}


</style>

</head>

<body>


<div>

The translate() method moves an element from its current position. This div element is moved 50 pixels to the right, and 100 pixels down from its current position.

</div>


</body>

</html>

 

چرخاندن - ()rotate

 

متد ()rotate عناصر را بر طبق زاویه ای که به آن میدهیم به صورت ساعتگرد یا برعکس میچرخاند.

مثال زیر عنصر <div> را 20 درجه به صورت ساعت گرد میچرخاند:

div {
    transform: rotate(20deg);
}

 

تغییر اندازه - ()scale

 

متد ()scale سایز یک عنصر را بر طبق پارامترهایی که به متد داده ایم کاهش یا افزایش میدهد.

مثال زیر اندازه عنصر <div> را نسبت به پهنای اصلی آن دو برابر و نسبت به ارتفاع اصلی آن سه برابر بزگتر میکند:

div {

    transform: scale(2,3);
}

با توجه به مثال متوجه میشویم که پارامتر اول برای پهنا و پارامتر دوم برای ارتفاع استفاده میشود.

مثال زیر اندازه ارتفاع و پهنای عنصر <div> را نصف اندازه اصلی میکند:

div {
    transform: scale(0.5,0.5);
}

 

متد ()skewX

 

متد ()skewX یک عنصر را در امتداد محور x بر طبق زاویه ای که به آن داده ایم کج میکند.

مثال زیر عنصر <div> را 20 درجه در امتداد محور x کج میکند:

<head>

<style>

div {

    width: 300px;

    height: 100px;

    background-color: yellow;

    border: 1px solid black;

}


div#myDiv {

    transform: skewX(20deg);

}


</style>

</head>

<body>


<p>The skewX() method skews an element along the X-axis by the given angle.</p>


<div>

This a normal div element.

</div>


<div id="myDiv">

This div element is skewed 20 degrees along the X-axis.

</div>


</body>

</html>

 

متد ()skewY

 

متد ()skewY یک عنصر را در امتداد محور y بر طبق زاویه ای که به آن داده ایم کج میکند.

مثال زیر عنصر <div> را 20 درجه در امتداد محور y کج میکند:

div {
    transform: skewY(20deg);
}

 

متد ()skew

 

متد ()skew یک عنصر را در امتداد محور x و محور y بر طبق زاویه ای که به آن داده ایم کج میکند.

مثال زیر عنصر <div> را 20 درجه در امتداد محور x و 10 درجه در امتداد محور y کج میکند:

div {
   transform: skew(20deg, 10deg);
}

 

متد ()matrix

 

متد ()matrix همه تغییر شکلهای دو بعدی را در یک متد با هم ترکیب میکند. این متد دارای شش پارامتر میباشد، که میتوانید عناصر را بچرخانید، تغییر اندازه بدهید، حرکت بدهید و کج بکنید:

<html>

<head>

<style>

div {

    width: 300px;

    height: 100px;

    background-color: yellow;

    border: 1px solid black;

}


div#myDiv1 {

    transform: matrix(1, -0.3, 0, 1, 0, 0);

}


div#myDiv2 {

    transform: matrix(1, 0, 0.5, 1, 150, 0);

}


</style>

</head>

<body>


<p>The matrix() method combines all the 2D transform methods into one.</p>


<div>

This a normal div element.

</div>


<div id="myDiv1">

Using the matrix() method.

</div>


<div id="myDiv2">

Another use of the matrix() method.

</div>


</body>

</html>

 

دیدگاه‌ها

on viagra is doomed the girl how to use viagra for maximum effect how does viagra work pfizer viagra pills for sale he cheated stepsis by giving her viagra in the drink

viagra price generic viagra can a guy take viagra everyday cheap viagra cialis viagra interaction viagra before and after

https://viagrnetwork.com/# - viagra samples

quick loans bad credit with monthly payments quick small loans online quick loan $1500 quick cash loans today quick cash loans tulsa ok

quick and easy personal loans online quick loans dayton blvd quick loans quick loans no credit check near me quick loans rates

quick loans 100% approval quick loans deposit same day quick loans quick 200 dollar loans quick business loans for startups

low interet rate quick loans quick loans online quick loans quick cash loans incorp huntington park ca quick credit loans

https://paydailoanz.com/# - quick loans

loans quick quick payday loans quick loan quick & easy personal loans quick loans deposit same day

student quick loans kenya quick loans 100% approval quick loans quick same day payday loans quick and loans arena

https://paydailoanz.com/# - quick loan

how does venmo make money how do youtubers make money work from home imgclick will easily make money sharing photos friends social free file upload legit ways to make money online

how much money can you make on youtube how to make money on twitch work from home how to make quick money how to make money online from home

https://make-money-blogs.com/# - work from home

how did mark cuban make his money how does facebook make money make money how to make money online how to earn money online or gift cards to amazon where did nancy pelosi make her money

make extra money how to make money selling drugs work from home legitimate ways make extra money how to make money with youtube

https://make-money-blogs.com/# - make money

how did tom steyer make his money make money blogging make money how to make money on amazon best way to make money

how to make money online how to earn money online or gift cards to amazon how to make money on amazon work from home how to make quick money make money now instant payout

https://make-money-blogs.com/# - work from home

how to start a blog and make money how to make money online for free work from home how can i make money make money fast

hobbies that make money make money on the side work from home best ways to make money online how does facebook make money

https://make-money-blogs.com/# - make money

how to make money on instagram how much money do youtubers make work from home how to make money on instagram how to make money online for free

how to make money without a job how to make money with a website work from home money make how to make money on the side

http://www.patientmedicine.ru/ - make money

how do youtubers make money how to make money without a job make money how much money does pewdiepie make how to make money online for free

make money online make money at home work from home how to make money from home legit ways to make money online

http://www.abovo-books.ru/ - make money

how to make money with bitcoin how to make money on twitch make money make money online fast how to make money without a job

how to make money without a job best ways to make money online make money make money how does robinhood make money

https://yapregna9.ru/ - make money

how to make money blogging how did mark cuban make his money make money how to make money as a kid legitimate ways make extra money

how to make money online fast make money from home make money make money online ways to make money on the side

http://swizzstyle.ru/ - work from home

buy cbd oil cbd oil hemp cbd cbd gummies https://cbdoilwalmart.com/ - buy cbd oil online

how to make money on youtube videos how does venmo make money work from home how did george soros make his money how did jerry jones make his money

how to make money quick how to start a blog and make money work from home how to make money with a website free ways to make money online

http://my-tvset.ru/ - work from home

play online casino free casino games online best online casinos slot games

casino online http://onlinecasinogamespcx.com/ - real money casino free slots best online casinos free casino games online

casino online slots http://onlinecasinosw.com/ casino bonus codes online casino games free slots

play casino play online casino no deposit casino free casino games http://onlinecasinogamespcx.com/ - casino game

vegas slots online http://onlinecasinosw.com/ online casino real money free casino games online gold fish casino slots

free casino games online online slots slots for real money online casino games http://onlinecasinosw.com/ - world class casino slots

http://onlinecasinogamespcx.com/ casino real money free casino gold fish casino slots play online casino

casino online slots http://onlinecasinosw.com/ - casino real money casino bonus codes slots online casino bonus codes

best online casino http://onlinecasinosw.com/ - play slots online slots best online casino play slots

cashman casino slots real casino slots best online casinos online slots http://onlinecasinosw.com/ - online casino bonus

play casino http://onlinecasinogamespcx.com/ slots free online casino games free slots

online casino bonus casino slots casino games free slots games http://onlinecasinogamespcx.com/ - world class casino slots

casino bonus codes best online casinos free casino games

online casino games http://onlinecasinopc.com/ - casino play casino online slots online slot games casino bonus codes

casino bonus codes http://onlinecasinosw.com/ - play slots online cashman casino slots online casino real money slots for real money

cashman casino slots online slot games real money casino free casino http://onlinecasinopc.com/ - online casino gambling

casino game http://onlinecasinopc.com/ real money casino no deposit casino play online casino

casino online slots free casino online casino real money casino http://onlinecasinosw.com/ - free slots

slots games online casino games free slots

free slots http://playcasinosw.com/ - best online casino online casinos online gambling

casino bonus codes http://playcasinosw.com/ - casino game casino real money casino real money play casino

http://playcasinosw.com/ cashman casino slots online casinos free casino slot games free casino games online

http://onlinecasinopc.com/ free casino games slots online free casino slot games no deposit casino

http://playcasinosw.com/ vegas casino slots online casino real money slot games casino online

casino real money http://onlinecasinopc.com/ - free casino online slots play slots

play casino slots free play slots online casino games http://playcasinosw.com/ - play online casino

http://playcasinosw.com/ real casino slots slots for real money no deposit casino slots free

online gambling http://playcasinosw.com/ - slots for real money big fish casino slot games

http://playcasinosw.com/ slots games free online casinos cashman casino slots online casino

casino real money http://playcasinosw.com/ - casino bonus codes casino play online gambling

real money casino online casino gambling vegas slots online

slots free http://casinoplaysw.com/ - casino online casino play big fish casino

صفحه‌ها

افزودن دیدگاه جدید

دیدگاه

  • تگ‌های HTML مجاز: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • خطوط و پاراگراف‌ها بطور خودکار اعمال می‌شوند.
  • نشانی صفحه‌ها وب و پست الکترونیک بصورت خودکار به پیوند تبدیل می‌شوند.

Plain text

  • تگ‌های HTML مجاز نیستند.
  • نشانی صفحه‌ها وب و پست الکترونیک بصورت خودکار به پیوند تبدیل می‌شوند.
  • خطوط و پاراگراف‌ها بطور خودکار اعمال می‌شوند.
كد امنيتي
این پرسش برای جلوگیری از ارسال اسپمهای اتوماتیک است.