Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

การแปลงข้อความโดยใช้ CSS


สำหรับการแปลงข้อความใน CSS ให้ใช้คุณสมบัติการแปลงข้อความด้วยค่าต่อไปนี้ -

text-transform: none|capitalize|uppercase|lowercase|initial|inherit;

ตัวอย่าง

<!DOCTYPE html>
<html>
<head>
<style>
div {
   line-height: 1.9;
   text-transform: uppercase;
}
</style>
</head>
<body>
<h1>Demo Heading</h1>
<div>
<p>This is demo text.<br>
This is another demo text.
</p>
</div>
</body>
</html>

ผลลัพธ์

การแปลงข้อความโดยใช้ CSS

ตัวอย่าง

เรามาดูตัวอย่างกัน −

<!DOCTYPE html>
<html>
<head>
<style>
div {
   text-transform: lowercase;
}
</style>
</head>
<body>
<h1>Demo Heading</h1>
<div>
<p>THIS is demo text.<br>
This is ANOTHER demo text.
</p>
</div>
</body>
</html>

ผลลัพธ์

การแปลงข้อความโดยใช้ CSS