You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

155 lines
5.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Css Text</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
a {
text-decoration: none;
}
.test {
color: red;
background-color: #000;
padding: 10px;
text-align: right;
text-align: left;
text-align: center;
text-align: justify;
font-size: 20px;
line-height: 30px;
}
.test-2 {
text-decoration: overline;
text-decoration: underline;
text-decoration: line-through;
text-transform: capitalize;
text-transform: lowercase;
text-transform: uppercase;
}
.test-4 {
text-indent: 10px;
letter-spacing: 10px;
word-spacing: 10px;
}
.taxt-shadow {
text-shadow: 5px 5px 5px green;
}
.test-5 {
width: 150px;
white-space: nowrap;
overflow: hidden;
text-overflow: clip;
text-overflow: ellipsis;
word-break: break-all;
}
.test-6 {
writing-mode: horizontal-tb;
/* حالت عادی */
}
.test-7 {
writing-mode: vertical-rl;
}
</style>
</head>
<!--
text-align: justify
برای تراز کردن متن استفاده میشود به طور مثال اگر متن طولانی باشد باعث میشود که متن تا انتها را پر میکند.
line-height:
فاصله ی بین خطوط را مشحص میکند
سایز فونت * 1.5
مقدار بالا بهترین مقدار برای متون فارسی است
سایز فونت * 1.6
مقدار بالا بهترین مقدار برای متون انگلیسی است
text-decoration:
روی متن خط میکشد
همهان کار <s>
text-indent:
از سر خط فاصله میگذارد
همان کار پدینگ را انجام0 میدهد
اما فقط برای خط اول
letter-spacing:
فاصله ی بین حروف
word-spacing:
فاصله ی بین کلمات
taxt-shadow:
مقدار اول : میزان فاصله از محور x
مقدار دوم : میزان فاصله از محور y
مقدار سوم : میزان بلور
white-space: nowrap
متن را نمیشکند
text-overflow: ellipsis
حتما باید متن اندازه داشته باشد و اگر متن سرریز کند سه نقطه قرار میدهد
باید با
overflow: hidden
حتما بیاید در غیر این صورت کار نخواهد کرد
word-wrap: breack-word;
کلمه ای که اندازه آن بیشتر از طول متن است را میشکند که بسیار نادر است
word-break: break-all
مشابه
text-align: justify
است
اما تفاوت این دو در این است که این مورد کلمه را می شکند اما قیلی کلمه را نمیشکند و
به شکلی متن را فاصله می دهد که فضا را بپوشاند
word-break : keep-all
حالت پیشفرض است
vertical-align: top;
برای این مورد نسبت به بزرگترین المانی که در آن وجود دارد الاین میشود
برای بزرگترین عنصر از نظر ارتفاع در کنار بقیه ی اعضا
vertical-align: base-line
میشود جایی که ارتفاع برزگترین عنصر تمام شده است
یعنی در پایین آن
middle top baseline bottom
می توان به آن مقدار عددی داد
vertical align : 20px;
عدد منفی هم میگیرد
font shorthand:
font: fontstyle fontweight fontsize fontfamily;
-->
<body>
<p class="test">این یک متن تستی است</p>
<a href="">link</a>
<p class="test-2">this is some random text</p>
<p class="test-4">this is some random text</p>
<p class="taxt-shadow">this is some random text</p>
<p class="test-5">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Laboriosam, asperiores! Voluptatum alias
porro exercitationem magni, explicabo quo facere? Nisi repellat delectus, eaque sit temporibus nam itaque saepe
ullam suscipit debitis! Ea eius, modi laborum dicta nobis dolor illum officia eaque. Quam, facere obcaecati
exercitationem consequuntur nam alias non quibusdam voluptatum. Possimus itaque labore autem quas ea illo unde
dolorum dicta?
</p>
<p class="test-6">این یک متن تستی است </p>
<p>این تستی <span class="test-7">یک متن </span> است </p>
<p class="test-8">این یک متن تستی است </p>
</body>
</html>