<?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: drinkmeasap</title>
    <description>The latest articles on DEV Community by drinkmeasap (@drinkmeasap).</description>
    <link>https://dev.to/drinkmeasap</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%2F224411%2F4e9c9246-fc44-4941-813f-1e28e9d80482.png</url>
      <title>DEV Community: drinkmeasap</title>
      <link>https://dev.to/drinkmeasap</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/drinkmeasap"/>
    <language>en</language>
    <item>
      <title>Simple CSS Animation ( Animating a button )</title>
      <dc:creator>drinkmeasap</dc:creator>
      <pubDate>Thu, 05 Sep 2019 17:31:37 +0000</pubDate>
      <link>https://dev.to/drinkmeasap/simple-css-animation-animating-a-button-2c4g</link>
      <guid>https://dev.to/drinkmeasap/simple-css-animation-animating-a-button-2c4g</guid>
      <description>&lt;p&gt;A simple CSS animation can draw your visitors attention to some important part of your interface. You can also use these animations to make your website look more interesting!&lt;/p&gt;

&lt;p&gt;Starting off, I will not go through the button CSS but here is the design used.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Now, to use a CSS animation we must first specify our keyframes for the animation.&lt;/p&gt;

&lt;p&gt;One simple example of this could be&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="k"&gt;@keyframes&lt;/span&gt; &lt;span class="n"&gt;example&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="err"&gt;40&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
  &lt;span class="err"&gt;80&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&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;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FZIOySLE.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FZIOySLE.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this animation the same CSS for the button style above was used, a animation time of 2 seconds was specified to that button class on hover through following&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;.btn&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;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;example&lt;/span&gt; &lt;span class="m"&gt;2s&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;This means that at 0% of the animation the background of the button is white which was specified at the&amp;nbsp;.btn class. At 40% of 2 seconds it will be changed gradually from White to Green and then from 40% - 80% change from Green to Red, then return to the button specified background color.&lt;/p&gt;

&lt;p&gt;Using these keyframes we can do a lot of various things with the button such as making it shake by&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;Which provides this following effect when hovering the button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2Fzxj31OL.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2Fzxj31OL.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this example it simply moves the button a few pixels gradually between each keyframe.&lt;/p&gt;

&lt;p&gt;I should note that if you don't want the animation for something to trigger on hover, instead trigger after a certain time you can use&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;animation-delay&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;s&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and enter how many seconds after the page loads you want to run the animation.&lt;/p&gt;

&lt;p&gt;Now after you've read this far you might be curious about what other properties you can animate. This following article will show you a list of properties that you can use to animate.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties?source=post_page-----c996cc4632dd----------------------" rel="noopener noreferrer"&gt;Firefox MDN&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feel free to ask anything if you have any questions!&lt;/p&gt;

</description>
      <category>css</category>
      <category>html</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Positioning a text over an Image using CSS / HTML</title>
      <dc:creator>drinkmeasap</dc:creator>
      <pubDate>Thu, 05 Sep 2019 17:01:32 +0000</pubDate>
      <link>https://dev.to/drinkmeasap/positioning-a-text-over-an-image-using-css-html-4jjn</link>
      <guid>https://dev.to/drinkmeasap/positioning-a-text-over-an-image-using-css-html-4jjn</guid>
      <description>&lt;p&gt;Starting off we'll use this simple html layout, start by changing the img src to the image you will be using.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;and we will also be using this css stylesheet.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Now we have a text in the center of this image.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2F1qLmpn3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2F1qLmpn3.png" alt="https://unsplash.com/photos/qxT5_usxqsE"&gt;&lt;/a&gt;&lt;br&gt;
A text-shadow can sometimes make the text more visible. Another way to make the text more visible is to add a box around your text with a low opacity.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FiuoxfGB.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FiuoxfGB.png" alt="https://unsplash.com/photos/qxT5_usxqsE"&gt;&lt;/a&gt;&lt;br&gt;
CSS for the box&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Wrapping the Image and Divs with this box class&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Feel free to ask if you have any questions!&lt;/p&gt;

</description>
      <category>css</category>
      <category>html</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
