Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use slash after HTML tag

Tags:

html

I use a HTML theme for my website. In this theme, there are form tags are shown as <form/>. Why does this theme use a slash after first form tag?

<div class="widget-body"> 
   <div class="widget-main"> 
      <form class="form-search" />
       <input type="text" class="input-medium search-query" /> 
       <button onclick="return false;" class="btn btn-purple btn-small"> 
          Search <i class="icon-search icon-on-right bigger-110"></i> 
       </button> 
      </form>
   </div> 
</div>
like image 469
ali Avatar asked Nov 05 '25 21:11

ali


1 Answers

In XHTML syntax, an <example /> tag is equivalent to <example></example> tags.

So, your line of code <input type="text" class="input-medium search-query" />, is equivalent to <input type="text" class="input-medium search-query"></input>.

like image 50
racecarjonathan Avatar answered Nov 07 '25 14:11

racecarjonathan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!