Where can I practice my HTML, CSS, and JavaScript?

Where can I practice my HTML, CSS, and JavaScript

If you think you have enough knowledge of HTML, CSS, and JavaScript you can practice it through your computer.

So what to do?

How to incorporate all the things you learned into a single project?

Simple, create an example website/webpage.

First, create a topic.

What topic would it be? Well, don’t make it complicated since you are just starting out. Maybe just a simple website where users can navigate through pages, it’s all up to you.

  1. Create localhost on your computer. This is optional only but it will you expand your knowledge on how a website and hosting works.
  2. In creating your webpage, you must decide what elements will appear on those pages. Example, we are creating a four pages website. The pages are home, about us, contact, and blog.
  3. Picture out those pages, all of the pages are the same but except for its content. The point is to code the global sections first! The header where the logo and navigation lies, and the footer.
  4. The process is normally you create your HTML markup (webpage structure). Next, design it with CSS and the JS comes after that. This doesn’t mean you can’t touch your markup once you are done with styling (CSS). You are practicing, so you can tweak whatever you want.

Where can I practice online?

Try with an online code editor like jsfiddle or codepen. You can save or share your code created in there.

What is next after I learned HTML, CSS, and JavaScript?

You can study the different libraries like Jquery, a javascript library. Or start learning about Php language.

Learn more about CSS, HTML, Javascript in 22bulbjungle.

How to Create a CSS Glow Effect on Hover

css glow effect

The CSS Glow Effect on hover can be done by using the box-shadow styles. We also have to add transition property to the element.

Step number 1. Let’s create an anchor tag element

  1. <a href="#">glow</a>

Step 2: Add background color and other styles

In our anchor tag, let’s add a background color and change default styles.

I’m going to remove the text-decoration. Add a padding of 15px into top and bottom and 25px for left and right side.

I also add values for fonts, just look into the code below:

  1. a{
  2. background-color: orange;
  3. text-decoration:none;
  4. padding: 15px 25px;
  5. font-family: sans-serif;
  6. font-size: 25px;
  7. color: #fff;
  8. border-radius:10px;
  9. display: inline-block;
  10. }

Read also:

Step 3: Add another selector for hover state

Create another anchor tag selector with :hover state. It should look like this:

  1. a:hover{
  3. }

Step 4. Add the box-shadow styles.

Here is where the magic happens.

Let’s add the box-shadow styles.

We can manually create it on CSS or we can also use the CSS box-shadow generator.

Box-shadow in CSS is the same with text-shadow value parameters. You can view a tutorial on CSS shadow in this video.

In this tutorial, I’m going to use the box-shadow generator.

Get this cool CSS hover effects collection here.

Step 5. Set the Blur Radius.

css shadow generator

From there, you will have to set the Horizontal Length and Vertical Length into zero to ensure that the glow would be the same on both sides of the element.

It is important to have a higher blur radius. This would create the CSS glowing effect. I set this into 100.

Set the Shadow color. I will set the color the same background color with my element.

Leave the other options and copy the code you see on the right.

Step 6. Add the box-shadow styles

That’s it, add these styles to the :hover element.

  1. a:hover{
  2. -webkit-box-shadow: 0px 0px 100px 0px rgba(255,165,0,1);
  3. -moz-box-shadow: 0px 0px 100px 0px rgba(255,165,0,1);
  4. box-shadow: 0px 0px 100px 0px rgba(255,165,0,1);
  5. }

If you try to hover over our element you will see that our shadow has been applied but we don’t like to make it appear real quick.

We will add a delay into the :hover state with our element so it’ll appear as if it was glowing.

I’m going to add transition: .8s ease.

Notice after you add and hover into the anchor tag, the element shows the box-shadow slowly thanks to our transition property.

But it disappears really quick when we unhover?


Just add another transition property with value into the anchor tag.

The final CSS code should look like this:

  1. a{
  2. background-color: orange;
  3. text-decoration:none;
  4. padding: 15px 25px;
  5. font-family: sans-serif;
  6. font-size: 25px;
  7. color: #fff;
  8. border-radius:10px;
  9. display: inline-block;
  10. transition: .8s ease
  11. }
  12. a:hover{
  13. -webkit-box-shadow: 0px 0px 100px 0px rgba(255,165,0,1);
  14. -moz-box-shadow: 0px 0px 100px 0px rgba(255,165,0,1);
  15. box-shadow: 0px 0px 100px 0px rgba(255,165,0,1);
  16. transition: .8s ease;
  17. }

CSS Hover Effects | Fade in Text with Background Source Code

Fade in Text with Background Hover

This video is going to show you how to create a CSS Fade in text with background Hover effect. An image is covered with a solid color fades in with a text when a user hovers it.


  1. &lt;!DOCTYPE html&gt;
  2. &lt;html&gt;
  3. &lt;head&gt;
  4. &lt;/head&gt;
  5. &lt;body&gt;
  8. &lt;div class=&quot;wrapper&quot;&gt;
  9.  &lt;img src=&quot;animal.jpeg&quot;&gt;
  12. &lt;div class=&quot;overlay&quot;&gt;
  15. &lt;div class=&quot;content&quot;&gt;Fade In&lt;span&gt;Fade In text&lt;/span&gt;&lt;/div&gt;
  18.  &lt;/div&gt;
  21. &lt;/div&gt;
  25. &lt;/body&gt;
  26. &lt;/html&gt;


  1. .wrapper {
  2. font-family: sans-serif;
  3. width: 80%;
  4. margin: 0 auto;
  5. position: relative;
  6. }
  8. img {
  9. display: block;
  10. width: 100%;
  11. height: auto;
  12. }
  13. .content {
  14. position: absolute;
  15. top: 45%;
  16. left: 50%;
  17. transform: translate(-50%, -50%);
  18. -ms-transform: translate(-50%, -50%);
  19. color: #fff;
  20. text-transform: uppercase;
  21. font-size: 60px;
  22. }
  24. .content span{
  25. font-size: 24px;
  26. display: block
  27. }
  29. .overlay {
  30. position: absolute;
  31. top: 0;
  32. bottom: 0;
  33. left: 0;
  34. right: 0;
  35. height: 100%;
  36. width: 100%;
  37. opacity: 0;
  38. transition: .5s ease;
  39. background-color: #ff771d;
  40. }
  42. .wrapper:hover .overlay {
  43. opacity: 1;
  44. }

Fade In Background Opacity(transparent) Hover


  1. &lt;!DOCTYPE html&gt;
  2. &lt;html&gt;
  3. &lt;head&gt;
  4. &lt;title&gt;CSS hover effects: Fade In Background opacity&lt;/title&gt;
  5. &lt;/head&gt;
  7. &lt;body&gt;
  12. &lt;div class=&quot;wrapper&quot;&gt;
  13. &lt;img src=&quot;highland.jpeg&quot;&gt;
  17. &lt;div class=&quot;overlay&quot;&gt;
  20. &lt;div class=&quot;content&quot;&gt;
  21. the title &lt;a&gt;read more&lt;/a&gt;
  22. &lt;/div&gt;
  26. &lt;/div&gt;
  30. &lt;/div&gt;
  35. &lt;/body&gt;
  36. &lt;/html&gt;


  1. .wrapper{
  2. font-family:sans-serif;
  3. width: 80%;
  4. margin: 0 auto;
  5. position:relative;
  6. }
  7. img{
  8. opacity: 1;
  9. display: block;
  10. width:100%;
  11. height: auto;
  12. transition: .5s ease;
  13. }
  14. .content{
  15. position: absolute;
  16. top:45%;
  17. left: 50%;
  18. transform: translate(-50%, -50%);
  19. -ms-transform: translate(-50%, -50%);
  20. text-transform: uppercase;
  21. font-size: 60px;
  22. color:#fff;
  23. white-space: nowrap;
  24. overflow: hidden
  25. }
  26. .content a{
  27. font-size: 24px;
  28. display: block;
  29. background-color: #ff771d;
  30. text-align: center;
  31. padding: 10px;
  32. cursor: pointer
  33. }
  34. .overlay{
  35. opacity: 0
  36. }
  37. .wrapper:hover img{
  38. opacity: .5
  39. }
  40. .wrapper:hover .overlay{
  41. opacity: 1
  42. }

How to Center an Image in CSS Very Easily

center image in css

There are few pointers to center an image in CSS.

  • First, make sure that the parent element of the image has its width set.
  • Second, the image should not be wider than its parent element, that’s pretty obvious.

See also:  How To Center A Div Inside A Div Easily

Center and Image in CSS horizontally

Images are the same as divs, you can use the text-align into its parent element but not the margin: 0 auto alone on the image.
To center image in div, set a width of the div then add margin:0 auto and display: block into the image in CSS.

The HTML code:

  1. <div class="wrapper">
  2.  <img src="http://22bulbjungle.com/wp-content/uploads/2017/04/rabbit_in_hand.jpg"></div>

The CSS styles:

  1. .wrapper{
  2. width: 100%;
  3. height: 300px;
  4. border: 2px solid #93c504;
  5. }
  6. img{
  7. max-width: 250px;
  8. display: block;
  9. margin: 0 auto
  10. }

This will result into an image centered horizontally:



See the jsfiddle:

Make sure you have a smaller image width than the parent element.

The margin’s first value 0 was for the top and bottom margin. While the second is for left and right margin.

You can also set margin-left: auto and margin-right: auto on the image in CSS.

Center an Image in CSS horizontally and vertically

We will going to use the span element to guide our image  making it center. Setting an image with margin and text-alignment could not make our image center align.

The HTML code:

  1. <div class="wrapper">
  2.  <span class="for-image"></span>
  3.  <img src="http://22bulbjungle.com/wp-content/uploads/2017/04/rabbit_in_hand.jpg"></div>

The CSS styles:

  1. .wrapper {
  2. width: 100%;
  3. height: 300px;
  4. border: 2px solid #93c504;
  5. text-align: center
  6. }
  8. .for-image {
  9. height: 100%;
  10. display: inline-block;
  11. vertical-align: middle
  12. }
  14. img {
  15. max-width: 200px;
  16. height: auto;
  17. background: #3A6F9A;
  18. vertical-align: middle
  19. }


Responsive design images

Creating a responsive design image is very useful for mobile devices.

Responsive image will automatically scale down and adjust to the width of the device.

To create a responsive design image, you just set a max-width: 100%; and height: auto; into the images.

The max-width: 100%; means the image’s width will cover all its parent’s width. You can also set a natural image width(full resolution width of the image) to the max-width property so it will not be basing upon its parent element’s width.

The height: auto; makes the image height and width proportional. As a result, it would not stretch.

What happens if you will not set a height: auto; is, the image’s original height will still be the same while the width is scaling according to the device’s width, so it will be non-proportional.

Background Image Color Overlay | Create a Filter Look with CSS


To add a color overlay to the background image, I am going to use CSS.

First of all, adding a CSS background image color overlay is the most dynamic way of creating tinted web page images. It became popular to many websites which appear in homepage as banners.



The great thing about adding background image color overlay is that you can just change any image (normal image without filter) dynamically and publish it on your website with filter, thanks to CSS.

So, how to do it?

Watch the video or continue reading.

See also:

Add a background property

(Yes not a background-image or background-color).

Within the background property, I add a linear gradient and a URL to the image.  I am using a linear-gradient background with transparency.

  1. background:
  2.    linear-gradient(
  3.    rgba (255, 255, 255, 0.5),
  4.    rgba (255, 255, 255, 0.5)
  5.    ),
  6.    url(image.jpg)

In one CSS property, I need to set two backgrounds. The first one is the linear-gradient color and the second is the actual image.

Because I need to add transparency for the background color opacity, I will define RGBA inside the linear gradient.


  1. linear-gradient(
  2.    rgba (255, 255, 255, 0.5),
  3.    rgba (255, 255, 255, 0.5)
  4.    );

The RGBA is an RGB color with an alpha channel. The alpha channel must be set between 0.0 to 1.0. It is the last parameter of the RGBA. The RGBA parameters are composed of red, green, blue, alpha.

Example: rgba (255, 255, 255, 0.5)

How to choose and get a color?

To make it easier for you to choose the color, create your web page document copying the code from here. Open it in the browser.

Developer tool in your browser is your friend. Right-click and inspect your web page (or CTRL+SHIFT+I).

On your div with the background style, click on the colored square or circle and a color picker will appear. Choose your color by dragging into the palette.


Change the opacity of the color you’ve picked, that is important so we can mimic the overlay or color filter effect in photoshop with our background image.

You can also use CSS Gradient Generator from sites like colorzillacssmatic, or cssportal.

See the jsfiddle:

Use the background-blend-mode

Are you familiar with Photoshop blend modes?

Well, I can also blend our background but with CSS.

I can also use the linear-gradient without the transparency and add a background-blend-mode: soft-light;

The CSS code should look like this:

  1. .block {
  2.  height: 350px;
  3.  background: linear-gradient(yellow, yellow), url(image.jpg);
  4.  background-size: cover;
  5.  text-align: center;
  6.  background-blend-mode: soft-light;
  7. }

As a result, the image and the color blended together in soft-light. Unlike the other way in which I can adjust the opacity.

You can experiment by adding different value into the background-blend-mode property.

background-blend-mode values include:

  • normal
  • multiply
  • screen
  • overlay
  • darken
  • lighten
  • color-dodge
  • saturation
  • color
  • luminosity

CSS Background image color overlay in hover

Add a background image color overlay if the user hovers over the image.

In conclusion, adding the color filter effect can be done in two ways. The first is through a background property with the linear gradient and image url.

The other is to add a solid color within the parameter of linear-gradient and add the background-blend-mode property.

Creating a Hero Image with color filter overlay on hover

Hero image is a large website banner image. It is composed of the background image, texts and even a button.

Learn how to create your hero image with CSS background image color overlay by watching the video below:

You can use either of the two techniques to add the effect into your CSS background image.

How To Disable Text Selection With CSS User Select

css user select

By default, texts on any web page can be highlighted and copied. Disable the highlight function also disables someone to copy the texts in the document. Using CSS user select makes the texts unselectable.

If for some reasons, you do not want your texts inside the button or paragraph to highlighted. CSS user select style attribute might help you.

So how to disable text selection with CSS user select?

Learn how by watching this video or continue reading.

See more amazing CSS videos in youtube: Garnatti one

Target an element and add the following styles

-webkit-touch-callout: none;

It is self-explanatory, add these styles disable the text selection.
Try to select the sentence demo below. This sentence was added with the CSS user select styles.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Notice that you cannot highlight the sentence above means the styles that added worked.

The-webkit-touch-callout attribute targets the ios safari browser, -webkit-user-select targets Chrome, Opera and Safari browsers, -khtml-user-select targets Konqueror, -moz-user-select targets Mozilla firefox and -ms-user-select:none targets internet explorer.

You can use this technique if you want to…

Prevent people from copying your content. Unfortunately, it can be useless if people inspect your code from the browser. They can just copy the content within the source code.

Do not want somebody to copy your contents? The better way is to disable the right-click mouse function.

How To Link CSS To HTML | Step By Step

how to link css to html

There are three ways to link css to html: inline, internal and external stylesheets.

Here is the video you can watch to better see how the different stylesheets are implemented or continue reading for a detailed explanation.

See more amazing CSS videos in youtube: Garnatti one

1. Inline

Use inline style if you want to add a style uniquely to an element. Just add style attribute to the chosen element/tag and then add the style attribute and value.

<h1 style=”font-family:arial; color:red”>Hello World !</h1>

2. Internal

If you want your css to be within the same page as your webpage then internal css stylesheet is for you. Inside the head section add an opening and closing style tag. In the opening style element, add type attribute equals to ”text/css” .

<style type=”text/css”> </style>

Between your opening and closing style tags add desired styling attribute by targeting elements.


<style type=”text/css”> h1{
	font-family: ‘arial’;
	color: red;
} </style>

3. External

If you want your files to be organized then use external css stylesheet. Create a css file and save(the same level with the html file).

Name your css file whatever you want I name mine as style.css. Inside in your head section in html add a link tag to link our css file.


<link rel=”stylesheet” type=”text/css” href=”style.css”>

We can now add styles inside our style.css file just like the internal css styles above but without the open and closing style tags.

How To Center A Div Inside A Div Easily


Why do we center a div inside a div element? Notice most of any website’s main content block always on the middle or a picture perfectly aligned on the middle.

There are a lot of ways to center a div inside a div. In this tutorial, I am going to show you two different ways to center a div element inside another.

These two videos might help you.

See also:  Center Align Texts in Vertical Position
Continue reading below if you don’t want to watch the video.

Margin to center a div

Make the margin of the child div (the div inside the div) set to zero and auto.

  1. .child-div{
  2.   margin: 0 auto;
  3. }


Notice the code above we have set the first value to zero. The zero value is the margin from the top and also from the bottom of the div. In the second value, we have not set a numeric value but an auto which makes the div go in the middle horizontally. It is the margin from left and right of the div.

Note: Make sure to set a width in your child and parent div for this to work. The parent div should have a greater width obviously.

Text Align to center a div

  1. .parent-div{
  2.   text-align: center;
  3. }

Telling the parent div to make its child’s text elements to center also makes the child div to center horizontally. As a result the texts inside our child div are also centered. Therefore, the last thing we need to do is to keep the text aligned to the left.

The solution, we should target the child div and add a CSS style but this time text alignment to the left or wherever you prefer.

how to center a div inside a div


  1. .child-div{
  2.   text-align:left;
  3. }

See more amazing CSS videos on youtube: Garnatti one

In conclusion, the two CSS styling techniques are both great methods to use to align a child div element in the middle. The margin attribute is better than the other since it will make your code lesser and simpler.