Công ty thiết kế website chuẩn SEO Web Mới
Tìm kiếm
Công ty thiết kế website chuẩn SEO Web Mới

Thuộc tính outline-width trong CSS

Thuộc tính outline-width trong CSS dùng để quy định độ rộng của đường viền chạy xung quanh thuộc tính border của phần tử HTML input, textarea, chi tiết như nào hãy cùng chúng tôi phân tích:

Thuộc tính outline-width trong CSS

Thuộc tính outline-width trong CSS

Chức năng của Thuộc tính outline-width trong CSS

Thuộc tính outline-width trong CSS dùng để quy định độ rộng của đường viền chạy xung quanh thuộc tính border của phần tử HTML input, textarea.

Các giá trị của Thuộc tính outline-width trong CSS

Ví dụ: outline-width:10px;

Con số: Là các con số theo px, ví dụ 3px, 5px, 7px.

medium: Độ rộng trung bình.

thin: Độ rộng cực nhỏ.

thick: Độ rộng lớn.

initial: Đưa giá trị của thuộc tính outline-style về giá trị mặc định

inherit: Kế thừa thuộc tính outline-style từ phần tử cha

Code Thuộc tính outline-width trong CSS

<!DOCTYPE html>
<html>
<head>
<title>Code Thuộc tính outline-width trong CSS</title>
<style>
* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;}
input{width:100%; height:35px; border:3px solid red; float:left; margin-bottom:20px; outline-style: dotted; outline-color:green}
textarea{width:100%; height:50px; border:3px solid red; float:left; margin-bottom:20px; outline-style: dotted; outline-color:green}
</style>
</head>
<body>
<h1>Code Thuộc tính outline-width trong CSS</h1>

<!--outline-width:5px;-->
<input style="outline-width:5px;" type="text" placeholder="outline-width:5px;">
<textarea style="outline-width:5px;" placeholder="outline-width:5px;"></textarea>

<!--outline-width:10px;-->
<input style="outline-width:10px;" type="text" placeholder="outline-width:10px;">
<textarea style="outline-width:10px;" placeholder="outline-width:10px;"></textarea>

<!--outline-width:medium;-->
<input style="outline-width:medium;" type="text" placeholder="outline-width:medium;">
<textarea style="outline-width:medium;" placeholder="outline-width:medium;"></textarea>

<!--outline-width:thin;-->
<input style="outline-width:thin;" type="text" placeholder="outline-width:thin;">
<textarea style="outline-width:thin;" placeholder="outline-width:thin;"></textarea>

<!--outline-width:thick;-->
<input style="outline-width:thick;" type="text" placeholder="outline-width:thick;">
<textarea style="outline-width:thick;" placeholder="outline-width:thick;"></textarea>

<!--outline-width:initial - Đưa giá trị của thuộc tính outline-style về giá trị mặc định-->
<input style="outline-width:initial;" type="text" placeholder="outline-width:initial;">
<textarea style="outline-width:initial;" placeholder="outline-width:initial;"></textarea>

<!--outline-width:inherit - Kế thừa thuộc tính outline-style từ phần tử cha-->
<input style="outline-width:inherit;" type="text" placeholder="outline-width:inherit;">
<textarea style="outline-width:inherit;" placeholder="outline-width:inherit;"></textarea>

</body>
</html>

Chạy Thử

Lời kết

Cảm ơn các bạn đã tham khảo bài viết Thuộc tính outline-width trong CSS.

  • 0 Bình luận
CEO Bùi Tấn Lực
Bùi Tấn Lực
CEO Bùi Tấn Lực người sáng lập ra Web Mới, là một lập trình viên website, người viết content, chuyên tư vấn các vấn đề về website và SEO website
  • Zalo
Chia sẻ nội dung đánh giá của bạn về Thuộc tính outline-width trong CSS
Email, Điện thoại của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *
Đánh giá của bạn
Tên *
Email
Số điện thoại *
Bình luận, Hỏi đáp
Đăng ký tư vấn miễn phí
Tìm hiểu 1 năm không bằng lắng nghe 1 câu tư vấn
Kiến thức PHP
Kiến thức JavaScript
Kiến thức về website
Kiến thức SEO website
0398.259.259