<?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: Aman Ansari</title>
    <description>The latest articles on DEV Community by Aman Ansari (@amanatg).</description>
    <link>https://dev.to/amanatg</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%2F462204%2F2d8977a6-0381-4c95-8f80-9632901f30e7.jpeg</url>
      <title>DEV Community: Aman Ansari</title>
      <link>https://dev.to/amanatg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amanatg"/>
    <language>en</language>
    <item>
      <title>4 CSS Properties You May Not Know About (But Should!)</title>
      <dc:creator>Aman Ansari</dc:creator>
      <pubDate>Tue, 13 Dec 2022 13:03:56 +0000</pubDate>
      <link>https://dev.to/amanatg/4-css-properties-you-may-not-know-about-but-should-26ng</link>
      <guid>https://dev.to/amanatg/4-css-properties-you-may-not-know-about-but-should-26ng</guid>
      <description>&lt;p&gt;As a front-end developer, it's important to have a solid understanding of CSS. In this blog post, I want to share some lesser-known CSS properties that can be useful in certain situations.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Sticky
&lt;/h2&gt;

&lt;p&gt;One property that is often overlooked is position: sticky. This allows an element to remain fixed in the viewport when the user scrolls past it. For example, you could use this to keep a navigation menu at the top of the page as the user scrolls down. Here's an example of how to use it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;nav&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;sticky&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Pointer-Events
&lt;/h2&gt;

&lt;p&gt;Another useful property is pointer-events, which allows you to control whether an element can be clicked or interacted with. This can be useful if you want to create an element that acts as a placeholder, or if you want to create a custom cursor. Here's an example of how to use it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.placeholder&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;pointer-events&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Filter
&lt;/h2&gt;

&lt;p&gt;You can also use the filter property to apply visual effects to an element. This can be useful for creating interesting hover effects, or for adjusting the brightness or contrast of an image. Here's an example of how to use it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;img&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;brightness&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Object-Fit
&lt;/h2&gt;

&lt;p&gt;Finally, the object-fit property allows you to control how an image fits inside its container. This can be useful if you want to prevent the image from being stretched or distorted. Here's an example of how to use it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;object-fit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cover&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are just a few of the lesser-known CSS properties that can be useful in certain situations. As always, it's important to test your code and make sure it works as expected across different devices and browsers. Happy coding!&lt;/p&gt;

</description>
      <category>fastapi</category>
      <category>flask</category>
    </item>
  </channel>
</rss>
