Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CSS effect multiple classes

Featured Replies

Does anyone know how to affect multiple classes from within CSS? For example I have a series of bars I'd to apply some universal CSS to. For example

.bar-1 .bar-2 .bar-3 and I want to apply "height: 10px;" to each without having to repeat it for each .bar-* class.

 

I've found similar uses within CSS elsewhere like:


[class=*-bar-*]

Edited by JordanC

Are they in a parent container? If so and if there aren't any other divs (that you don't want to target) in the parent container, you can use:

.parent div{
     height:10px;
} 

Why not

 

.bar1, .bar2, .bar3{height:10px}

or add an extra class

 

<ul>
<li class="bar1 barht">Your stuff</li>
<li class="bar2 barht">Your stuff</li>
<li class="bar3 barht">Your stuff</li>
<li class="bar4 barht">Your stuff</li>
<ul>

 

.barht{height:10px}

 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.