<?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: shammisharma</title>
    <description>The latest articles on DEV Community by shammisharma (@shammisharma).</description>
    <link>https://dev.to/shammisharma</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%2F861251%2Fadf0b682-9f16-453b-9faf-f716316f8904.png</url>
      <title>DEV Community: shammisharma</title>
      <link>https://dev.to/shammisharma</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shammisharma"/>
    <language>en</language>
    <item>
      <title>Use video as background with CSS</title>
      <dc:creator>shammisharma</dc:creator>
      <pubDate>Wed, 15 Feb 2023 09:25:55 +0000</pubDate>
      <link>https://dev.to/shammisharma/how-to-use-video-as-background-in-3-steps-32fp</link>
      <guid>https://dev.to/shammisharma/how-to-use-video-as-background-in-3-steps-32fp</guid>
      <description>&lt;p&gt;Using images as a background is something we always do with simple css property i.e &lt;br&gt;
&lt;code&gt;background:url(path to image)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;However, sometimes there is a need to use video as a background. In this post I will share a neat and simple trick to use video as a background.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1: Create Container
&lt;/h2&gt;

&lt;p&gt;First we will make a container in which video and other content will be there. Please note that height of the container will be relative to the height ratio of video. If you like you can limit it's height using (max-height) and hide overflow content with 'overflow:hidden'.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.vid-bg {width:100%; display:block; max-height: 500px; overflow:hidden;position:relative;margin:0; padding:0}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: Set overlay content
&lt;/h2&gt;

&lt;p&gt;This is the main part where we will be set our overlay content with the 'position:absolute' property. It will allow our content to remain on top of the video. Following is the code for overlay:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.vid-bg .content { width:100%; height:100%;top:0;position:absolute;background:rgba(0,0,0,0.6); padding:0px; color:#fff; text-align:center; font-size:30px; z-index:1; display:flex; align-items: center;
    justify-content: center;}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Use video element
&lt;/h2&gt;

&lt;p&gt;Now we will use our video. There are 3 main properties that we will be using which are : 'autoplay', 'loop' &amp;amp; 'muted'.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;autoplay: It will allow us to play our video as soon as its is loaded.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;loop : It will allow our video to play on loop.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;muted : This is crucial property because without this our video will not autoplay since chromium browsers only allow muted videos to autoplay.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Keep in mind the aspect ratio of video, if you want whole video to be shown then you will have to remove the 'max-height' property else your video will be clipped.&lt;/p&gt;

&lt;p&gt;Following is the full html &amp;amp; css code :&lt;br&gt;
HTML:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="vid-bg"&amp;gt;
&amp;lt;video muted  autoplay loop width="100%" src="https://joy1.videvo.net/videvo_files/video/free/2013-08/large_watermarked/hd0992_preview.mp4"&amp;gt;
&amp;lt;/video&amp;gt;
&amp;lt;div class="content"&amp;gt;&amp;lt;h1&amp;gt; Use Video as background &amp;lt;/h1&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CSS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.vid-bg {width:100%; display:block; max-height: 500px;  overflow:hidden;position:relative;margin:0; padding:0}

.vid-bg .content { width:100%; height:100%;top:0;position:absolute;background:rgba(0,0,0,0.6); padding:0px; color:#fff; text-align:center; font-size:30px; z-index:1; display:flex; align-items: center;
    justify-content: center;}

.vid-bg .content h1 {background: rgba(255, 255, 255, 0.5); padding:20px; color:#111; border-radius: 60px; font-size:30px; margin:0 10px;}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;TADA! You have done it. You can play around with following Codepen.&lt;/p&gt;

&lt;p&gt;P.S. : BONUS Content in Codepen! Please check it out.&lt;/p&gt;

&lt;p&gt;Thanks! Happy DEVing.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/shammishady/embed/ababrro?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>css</category>
      <category>html</category>
      <category>design</category>
    </item>
    <item>
      <title>How do you deal with Mouse Arm Syndrome ! Re : Tips that worked for me.</title>
      <dc:creator>shammisharma</dc:creator>
      <pubDate>Thu, 23 Jun 2022 11:04:29 +0000</pubDate>
      <link>https://dev.to/shammisharma/how-do-you-deal-with-mouse-arm-syndrome--3ian</link>
      <guid>https://dev.to/shammisharma/how-do-you-deal-with-mouse-arm-syndrome--3ian</guid>
      <description>&lt;p&gt;Mouse Arm Syndrome is a condition that affects the hand, wrist and shoulder that normally occurs in desk workers that are subject to repetitive strain using the mouse and keyboard.&lt;/p&gt;

&lt;p&gt;How do you deal with it and What measures you take to avoid it ?&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>help</category>
      <category>community</category>
      <category>programming</category>
    </item>
    <item>
      <title>My 1st portfolio website</title>
      <dc:creator>shammisharma</dc:creator>
      <pubDate>Mon, 13 Jun 2022 12:28:35 +0000</pubDate>
      <link>https://dev.to/shammisharma/rate-my-portfolio-c4e</link>
      <guid>https://dev.to/shammisharma/rate-my-portfolio-c4e</guid>
      <description>&lt;h2&gt;
  
  
  Portfolio URL
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://shammisharma.netlify.app"&gt;https://shammisharma.netlify.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Design Idea&lt;/strong&gt;&lt;br&gt;
So after 5 years I decided to built my portfolio website and share it. I went with minimalism approach where goal was to keep it simple and gave it a look of typical resume.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pages&lt;/strong&gt;&lt;br&gt;
It has 3 pages including profile page and two different portfolio pages. &lt;br&gt;
Profile page includes Brief, Work History, Roles, Skills &amp;amp; resume(pdf file) to download. For portfolio I decided to built 2 different pages to showcase some of my best works in web UI designing / development and graphics designing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deployment&lt;/strong&gt;&lt;br&gt;
For deployment I used my github profile to create page and then deployed it over Netlify.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Goal&lt;/strong&gt;&lt;br&gt;
My goal here is to take suggestions from you guys on how can I improve my website more to showcase my abilities and make best impression on recruiters.&lt;/p&gt;

&lt;p&gt;Thanks for reading. Kindly rate &amp;amp; let me know how can I improve.&lt;/p&gt;

</description>
      <category>portfolio</category>
      <category>discuss</category>
      <category>rate</category>
      <category>beginners</category>
    </item>
    <item>
      <title>As a Developer, what's that one thing you always want to say to Designers 😅 !</title>
      <dc:creator>shammisharma</dc:creator>
      <pubDate>Tue, 31 May 2022 06:16:36 +0000</pubDate>
      <link>https://dev.to/shammisharma/as-a-developer-whats-that-one-thing-you-always-want-to-say-to-designers--2ep5</link>
      <guid>https://dev.to/shammisharma/as-a-developer-whats-that-one-thing-you-always-want-to-say-to-designers--2ep5</guid>
      <description>&lt;p&gt;Hey developers, what's that one thing you always want to say to Designers. Advice, Suggestion, Question, complement anything.&lt;br&gt;
As a designer(+developer) I want to know what others developers go through while working on a project with designers.&lt;/p&gt;

</description>
      <category>developer</category>
      <category>designer</category>
      <category>discuss</category>
      <category>rant</category>
    </item>
    <item>
      <title>What I am ???</title>
      <dc:creator>shammisharma</dc:creator>
      <pubDate>Thu, 12 May 2022 06:24:07 +0000</pubDate>
      <link>https://dev.to/shammisharma/what-i-am--4c4b</link>
      <guid>https://dev.to/shammisharma/what-i-am--4c4b</guid>
      <description>&lt;p&gt;Hello everyone,&lt;br&gt;
I'm glad to joint this amazing community.&lt;br&gt;
I am a web designer, graphic designer, front end developer (html,css,js) for past 5 years or so but to be honest I'm feeling like a noob here. (image for context 😅).&lt;br&gt;
I seriously don't know where I stand in this field after this long time. If I consider myself a designer then besides photoshop, illustrator, css I know nothing. As for considering myself a developer I only have a knowledge of html css , bit of js (so that makes me a ultranoob).&lt;br&gt;
When I look at other designers or devs I feel so overwhelmed like whoa they know so much and I'm nowhere near them. Sometimes its so depressing for me. I seriously don't know what should I do.&lt;br&gt;
Have any of guys been through same ! kindly let me know. Any advice / help will be appreciated 🙂&lt;br&gt;
Thanks and looking forward to this journey on dev 👍🏻&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LEtc2ycD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lsz7nq6mpdc3x1lt8cq2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LEtc2ycD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lsz7nq6mpdc3x1lt8cq2.jpg" alt="Image description" width="880" height="1112"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>existensialcrisis</category>
      <category>newbie</category>
      <category>developer</category>
      <category>help</category>
    </item>
  </channel>
</rss>
