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.

H2 CSS not listening to width

Featured Replies

 

Hi, I'm having an issue with an H2 element not listening to my width command, I know the solution is probably really simple but my mind is slowly melting today! Here is the code I'm using:

 

 

#wpss_survey h2{
    font-family: 'Exo', sans-serif;
    font-size:24px;
    color:#fff;
    font-weight:bold;
    width:575px !important;
    background-image:url(images/awards-h2-png);
    background-color:transparent !important;
    height:40px;
    padding:0px;
    margin:0;
    display:inline-block;
}
 

 

Any and all help will be appreciated!

 

Cheers!

That code looks OK.

 

Double check that the h2 sits inside a parent element with the ID #wpss_survey.

 

If you add a 1px border to the CSS, you'll see the width taking effect. Maybe you're looking for the text-align:center; to force the text to the middle of the container?

 

Lyndsey.

It is sitting inside of the parent div, it listens to everything I have done apart from the width, it gets to around 400px and then cuts off.

ridermagazineDOTcoDOTuk/voltz-bmf-awards/

Article h2 got max width set on it

Perfect, cheers mate!

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.