<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sahrish Afzal</title>
    <description>The latest articles on DEV Community by Sahrish Afzal (@afzalsahrish).</description>
    <link>https://dev.to/afzalsahrish</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F614587%2F15fd735d-dc91-44f9-975b-30269d61c3e9.png</url>
      <title>DEV Community: Sahrish Afzal</title>
      <link>https://dev.to/afzalsahrish</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/afzalsahrish"/>
    <language>en</language>
    <item>
      <title>HTML elements and difference between &lt;p&gt; and &lt;span&gt; element</title>
      <dc:creator>Sahrish Afzal</dc:creator>
      <pubDate>Wed, 14 Apr 2021 20:05:35 +0000</pubDate>
      <link>https://dev.to/afzalsahrish/html-elements-and-difference-between-p-and-span-element-4j59</link>
      <guid>https://dev.to/afzalsahrish/html-elements-and-difference-between-p-and-span-element-4j59</guid>
      <description>&lt;p&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;br&gt;
&lt;/p&gt;


&lt;br&gt;
     &lt;br&gt;
     html element&lt;br&gt;
   





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; &amp;lt;p&amp;gt; This is a block level, therefore, add padding and margin before and after the line&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt; This is single line sentence.&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;span&amp;gt;This is inline element and therefore does not add any padding and margin before and after the line.&amp;lt;/span&amp;gt;
 &amp;lt;span&amp;gt;This is single line sentence.&amp;lt;/span&amp;gt;

&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Result/ output &lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is a block level, therefore, add padding and margin before and after the line&lt;/p&gt;

&lt;p&gt;This is single line sentence.&lt;/p&gt;

&lt;p&gt;This is inline element and therefore does not add any padding and margin before and after the line. This is single line sentence.&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;we can see that in case of the &lt;/p&gt;
&lt;p&gt; element the result printed on two different line, however, in span the same code printed on the same line.&lt;br&gt;
we actually use span element for styling purpose and it has not semantic meaning in html, however, the &lt;/p&gt;
&lt;p&gt; element is block element and has semantic meaning in HTML&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

</description>
    </item>
  </channel>
</rss>
