How-to articles, tricks, and solutions about CSS

How to Overlay One Div Over Another

In this snippet, we’ll demonstrate how you can create an overlay effect for two <div> elements. For that purpose, use the CSS position and z-index properties.

How to Override !important

It is possible to override !important, although it isn’t recommended to use !important at all. But you can override the !important rule with another !important.

How to Override CSS Styles

How CSS overriding works, what is the cascading order and inheritance, what are the priorities and some tricks to override them.

How to Place a Div in the Middle of the Screen when It is Smaller than the Page

On this page, we’ll demonstrate how you can place your <div> element in the middle of the screen. For that, you need to use the CSS position property.

How to Position One Image on Top of Another in HTML/CSS

Sometimes, you may need to place one image over another one. It can be easily done with HTML and CSS. See how to use the position and z-index properties.

How to Prevent Long Words from Breaking a Div

In this snippet, we are going to present some methods that you can use to prevent long words from breaking a <div> element. For that, use HTML and CSS.

How to Prevent Scrollbar from Repositioning Web Page

When you center a page, it may move slightly on some browsers when navigating between pages. In this snippet, we’ll demonstrate how to solve this problem.

How to Prevent the Appearance of Lines Around a Circle Created with clip-path

On this page, you will find out how it is possible to prevent the appearance of lines around a circle, which is created with the CSS clip-path property.

How to Relatively Position an Element without It Taking Space in the Document Flow

On this page, we’re going to demonstrate how you can relatively position an element without it having to take space in the document flow. Use CSS properties.

How to Remove All CSS Classes Using jQuery/JavaScript

In this tutorial, you can read and learn several easy and simple jQuery methods and pure JavaScript properties that are used to remove all CSS classes.

How to Remove and Style the Border Around Text Input Boxes in Google Chrome

Use outline: none to remove the ugly border color for a form field in Chrome. Learn also how to give your own style for showing that the box is active. All with examples.

How to Remove Background Image in CSS

The background image is manipulated with the background-image property. But you may need to remove the background image, and we’ll show how it can be done.

How to Remove Cellspacing from Tables Using CSS

CSS suggests flexible and useful properties to solve any problems that may occur. Remove the space between cells of the table with the border-collapse property.

How to Remove Default Arrow Icon from a Dropdown List

In this snippet, we’re going to demonstrate how you can remove the default arrow icon from a dropdown list. For that, you can use the appearance property.

How to Remove Focus Around Buttons on Click

In this snippet, you can see how to remove the focus around a button on click. To solve this problem, you use the CSS outline property with the “none” value.

How to Remove Style Added with the .css() function Using jQuery

Read this tutorial and learn several ways of removing style added with the .css() function with the help of jQuery. Choose the best method for your case.

How to Remove the CSS :hover Behavior from an Element

On this page, learn how to remove the CSS hover behavior from a specific element. For that, you can use the CSS pointer-events property or :not() pseudo-class.

How to Remove, Replace or Style List Bullets with Pure CSS

Learn the ways of removing, styling and replacing list bullets with images. Also how to make horizontal lists. All with examples.

How to Render an HTML String Preserving Spaces and Line Breaks

In this tutorial, you can learn how to render an HTML text preserving spaces and line breaks. You need to use the HTML <pre> tag or the CSS white-space property.

How to Replace col-xs-* in Bootstrap 4

On this page, find out how you can make a column equal to extra small. To make it work in Bootstrap 4, you need to replace the col-xs-* class with col-*.

How to Resize Background Images with CSS3

Learn about the ways of resizing and creating responsive background images. Use the CSS background-size property for that purpose. See examples.

How to Resize Images Proportionally for Responsive Web Design With CSS

Learn how to resize images to have a responsive web design. Use HTML attributes or CSS width and height properties. See examples and practice the methods for yourself.

How to Retrieve an HTML Element's Actual Width and Height

Read this tutorial and learn about the two methods that are used to retrieve an HTML element’s actual width and height. Find the best method for your case.

How to Right Align a Button with CSS

In this tutorial, we'll demonstrate how to align a button to the right with CSS. For that purpose, you need to use the CSS float property with its “right” value.

How to Right-Align a Flex Item

In this snippet, we’re going to demonstrate how you can right-align a flex item. For that, use the CSS justify-content property with the “space-between” value.