<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Samanvith M S on Medium]]></title>
        <description><![CDATA[Stories by Samanvith M S on Medium]]></description>
        <link>https://medium.com/@samanvith2002?source=rss-713546a1e9ba------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ECx7BjFVugHFkfD7hpggEg.jpeg</url>
            <title>Stories by Samanvith M S on Medium</title>
            <link>https://medium.com/@samanvith2002?source=rss-713546a1e9ba------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:16:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@samanvith2002/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[3 Most basic CSS display properties any budding Web Developer should know (Understand).]]></title>
            <link>https://medium.com/@samanvith2002/3-most-basic-css-display-properties-any-budding-web-developer-should-know-understand-6a539d42e2ac?source=rss-713546a1e9ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a539d42e2ac</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Samanvith M S]]></dc:creator>
            <pubDate>Tue, 17 Nov 2020 14:43:47 GMT</pubDate>
            <atom:updated>2020-11-17T15:00:23.946Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>CSS properties can be quite tricky for a first-timer in Web Development, but with proper understanding of the concepts anyone can master them.</blockquote><figure><img alt="An idea of different display styles in web development" src="https://cdn-images-1.medium.com/max/1024/0*wrjRIKZPmKaIbeoP" /><figcaption>Photo by <a href="https://unsplash.com/@halacious?utm_source=medium&amp;utm_medium=referral">Halacious</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Howdy Web Developers! I am Samanvith and I am glad you could join me. This is a short and sweet article about the basic CSS property- <strong><em>Display</em> </strong>and its types. If you already are well-versed with this topic just read the article to brush up your concepts. If not, don’t worry you shall be, by the end of this article😊.</p><p>Let’s dive into the topic right away!<br>So the display property as you know it deals with the display behaviour of any element in HTML. There are numerous types in which we can configure or change the way it displays on our screen according to our liking but we concentrate on a few, in this case only 3, they are:<br>-<strong> Block</strong><br>- <strong>Inline<br>- Inline-Block</strong></p><h3>Block</h3><blockquote>We start-off with the Block property as it is the default type in most of the cases.</blockquote><p>The display:block property when applied to an element takes up 100% space of its<strong> parent element.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*djItmNwqzvmhPN1r1JgZaA.png" /><figcaption>Child divs occupying the default size of their parent.</figcaption></figure><p>As you can see from the image above both the child divs have occupied 100% of the parent div which is 100vw <em>(vw-viewport width indicates the width of the screen).</em></p><p><strong>We can also manipulate the dimensions of the div just by adding the respective properties, the effect of which can be seen below.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JQdqE96Bx_-IuDtGC7ulqg.png" /><figcaption>Child divs after changing their widths.</figcaption></figure><p>Voila! we can see that the child divs can actually change their dimensions.</p><p>But if you notice the result carefully you will see that although the child divs sizes(<em>60%,40%</em>) sum up to the total width of the parent div(100%) but both of them are not on the same line which can sometimes be very frustrating.</p><p>Unfortunately, we can’t do that while using the display:block property.<br>But don’t worry we do have a couple of other types which can help us do that.</p><p><em>Which brings us to the next type of display property:</em></p><h3>Inline</h3><p>As the name suggests the display:inline property helps us overcome our problem by able to place the elements on the same line as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_X0cFy7L8-Qx7msf5CykOg.png" /></figure><p>Here, we see that the divs have been placed on a single line which we wanted.<br>But if you look closely, we again have a problem, can you guess what it could be??</p><p>Well, if you see the code at line no:30 and 36 you can see that the widths are 60% and 40% respectively, which should sum up to a 100% that means both the child divs should occupy the entire space, right? but that didn’t happen because when the display:inline property is given to an element it is tightly wrapped around the content hence, making it impossible for us to change the dimensions of the element with that property applied.</p><p><em>Which brings us to our final type of the display property:</em></p><h3>Inline-Block</h3><p>Yes, you guessed it right, the display:inline-block property combines the useful features of the <strong>Inline </strong>and the <strong>Block </strong>properties.</p><p>That means you can change the dimensions of the elements and also can place them on a single line like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6aVRy8QLA8Hyxsb6uL3amg.png" /><figcaption>The code for the inline-block property.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mSGMCGEmtCqWy--lDqFjng.png" /><figcaption>The result of the code written above.</figcaption></figure><p>As you have witnessed, the inline-block method has all the useful features from both the Block and the inline types.</p><blockquote>There are many more types of the display property which such as Flex which would require more time to understand. So look out for my other articles.<br>Hope you enjoyed my work, comment below to let me know anything regarding this article or the topics which you would like to read next.</blockquote><blockquote>Until then Keep making websites<br>Cheers!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a539d42e2ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>