Mobile app version of vmapp.org
Login or Join
Megan663

: What does the tag do in wordpress? I saw that using <hr /> before and after some content sort of lifts the content. Could anybody share what does the tag do and does it come/have

@Megan663

Posted in: #Html #Tags #Wordpress

I saw that using <hr /> before and after some content sort of lifts the content. Could anybody share what does the tag do and does it come/have antecedent from HTML 4.0 or is a tag done/manufactured by WordPress itself.

Example below -

some text
<hr />

<h3>tax which I need to highlight/breakaway <h3>

<hr />

&nbsp;


now I know that &nbsp; is for an empty line so that there is some space, while h3 is for headline 3 which makes text stand out a bit, do not get really what <hr /> actually does, can somebody explain?

Any links which also explain the above would also be good.

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Megan663

3 Comments

Sorted by latest first Latest Oldest Best

 

@Rambettina238

See the HTML 5 specification:


The hr element represents a paragraph-level thematic break, e.g. a scene change in a story, or a transition to another topic within a section of a reference book.


As such, it makes no sense to wrap a heading in a pair of them. That is something for which CSS borders would be more suitable.

e.g.

h3 {
border-top: solid black 2px;
border-bottom: solid black 2px;
padding-top: 5px;
padding-bottom: 5px;
}





does it come/have antecedent from HTML 4.0


It originally appeared in HTML 2.

10% popularity Vote Up Vote Down


 

@Harper822

To make sure code is correct, you should validate it at validator.w3c.org.

This code doesn't validate well:

<hr />

<h3>tax which I need to highlight/breakaway <h3>

<hr />

&nbsp;


I then chose to validate your code as an HTML fragment and one of the errors out of 4 that I see is:


NET-enabling start-tag requires SHORTTAG YES

For the current document, the validator interprets strings like according to legacy rules that break the expectations of most authors and thus cause confusing warnings and error messages from the validator. This interpretation is triggered by HTML 4 documents or other SGML-based HTML documents. To avoid the messages, simply remove the "/" character in such contexts. NB: If you expect to be interpreted as an XML-compatible "self-closing" tag, then you need to use XHTML or HTML5.

This warning and related errors may also be caused by an unquoted attribute value containing one or more "/". Example: w3c.org>W3C. In such cases, the solution is to put quotation marks around the value.


It also detected that you forgot to close your <h3> tag. The right-most <h3> should be </h3>

Also, <hr /> should be changed to <hr> which stands for horizontal rule (which is a line going across your screen).

These tags are HTML tags. If there are tags in Wordpress (maybe something like <wordpress configuration=set>), then they would be tags that wouldn't be used in an HTML document that a browser directly processes. They might be used as HTML comments instead. For example:

<div>
<p>
This is text inside html.
<!-- <wordpress configuration=set> -->
There is other text here inside html.
</p>
</div>


Here's a reference of standard HTML tags: www.w3schools.com/tags/

10% popularity Vote Up Vote Down


 

@Jennifer507

the hr tag is used to insert a horizontal line (aka "horizontal rule"). Depending on the styling of the hr tag via CSS, it can look many different ways.

Reference: www.w3schools.com/tags/tag_hr.asp

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme