علامة HTML <hr>


مثال

استخدم علامة <hr> لتحديد التغييرات الموضوعية في المحتوى:

<h1>The Main Languages of the Web</h1>

<p>HTML is the standard markup language for creating Web pages. HTML describes the structure of a Web page, and consists of a series of elements. HTML elements tell the browser how to display the content.</p>

<hr>

<p>CSS is a language that describes how HTML elements are to be displayed on screen, paper, or in other media. CSS saves a lot of work, because it can control the layout of multiple web pages all at once.</p>

<hr>

<p>JavaScript is the programming language of HTML and the Web. JavaScript can change HTML content and attribute values. JavaScript can change CSS. JavaScript can hide and show HTML elements, and more.</p>

المزيد من الأمثلة "جربها بنفسك" أدناه.


التعريف والاستخدام

تحدد العلامة <hr>فاصلًا موضوعيًا في صفحة HTML (على سبيل المثال ، تحول في الموضوع).

غالبًا ما يتم <hr>عرض العنصر كقاعدة أفقية تُستخدم لفصل المحتوى (أو تحديد تغيير) في صفحة HTML.


دعم المتصفح

Element
<hr> Yes Yes Yes Yes Yes

السمات العالمية

تدعم <hr>العلامة أيضًا السمات العامة في HTML .


سمات الحدث

تدعم <hr>العلامة أيضًا سمات الحدث في HTML .



مزيد من الأمثلة

مثال

محاذاة عنصر <hr> (مع CSS):

<hr style="width:50%;text-align:left;margin-left:0">

مثال

noshaded <hr> (مع CSS):

<hr style="height:2px;border-width:0;color:gray;background-color:gray">

مثال

اضبط ارتفاع عنصر <hr> (باستخدام CSS):

<hr style="height:30px">

مثال

اضبط عرض عنصر <hr> (باستخدام CSS):

<hr style="width:50%">

الصفحات ذات الصلة

مرجع DOM HTML: كائن الموارد البشرية


إعدادات CSS الافتراضية

ستعرض معظم المتصفحات <hr>العنصر بالقيم الافتراضية التالية:

مثال

hr {
  display: block;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  margin-left: auto;
  margin-right: auto;
  border-style: inset;
  border-width: 1px;
}