• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to center CSS responsive Box-Sizing

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to center CSS responsive Box-Sizing

This topic is: resolved

Tagged: box-sizing, css, Metro Pro, responsive

  • This topic has 3 replies, 2 voices, and was last updated 2 years, 4 months ago by Bianca.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • November 10, 2020 at 1:15 am #501844
    DJ Carl
    Participant

    Hello Folks,

    Trying to center the BOX for Metro Pro theme sidebar and mobile [responsive]. If you look real closely, it is more to the left...

    .update {
      width: 315px;
      border: 1px solid #4169E1;
      margin: 10px;
      box-sizing: border-box;
      padding: 5px;
      background-color: #DCDCDC;
    }

    `<div class="update"><center><span style="color: #080000; font-family: verdana,arial; font-size: 20px;">DJ SERVICE BENEFITS:</span></center><span style="color: #000000; font-family: verdana,arial; font-size: 14px;">Wouldn't it be fun if you could experience a music expert DJ emcee who (1) <a title="Buy a customized DJ MIX now" href="http://bit.ly/2A5Fkkb" target="_blank">mixes music</a> for all races, ages, and backgrounds, (3) <a title="Hear DJ Carl discuss the business services" href="https://media.blubrry.com/hip_hop_music_celebrity/djcarl.com/audio/voiceover-emcee-hosting-services.mp3" target="_blank">speaks professionally</a> on the microphone, and can (3) oversee your event with precise attention to details? You can trust DJ Carl©.</span><p></p>
    <center><span style="color: #080000; font-family: verdana,arial; font-size: 20px;">PODCAST DJ MIXES:</span></center><span style="color: #000000; font-family: verdana,arial; font-size: 14px;">Listen and stream <span style="color: #DC143C; font-family: verdana,arial; font-size: 13px;">NEW</span> <a title="Hip Hop Music 2020 Podcast" href="https://djcarl.com/hip-hop-music-2020/" target="_blank"><strong>Hip Hop Podcast #107</strong></a> and <span style="color: #DC143C; font-family: verdana,arial; font-size: 13px;">NEW</span> <a title="Dance Music 2020 Podcast" href="https://djcarl.com/dance-music-2020/" target="_blank"><strong>Dance Podcast #119</strong></a> now. Available on <a title="DJ Carl© Streaming | celebrity DJ Carl©" href="https://bit.ly/2zJSTr5" target="_blank">Apple</a>, Google, and Amazon Podcasts.</span></div>`

    https://djcarl.com/
    November 10, 2020 at 10:08 am #501851
    Bianca
    Participant

    Hi Carl,
    What do you mean exactly? When I visit your website I see the box properly aligned. However, I do see that the text in the box is left aligned. Is this what you mean? If so addtext-align:center; to the code you mention above.
    If not, can you clarify?


    I am a Marketing Communications specialist at Communics.

    Visit my personal website | Follow me on Twitter | Connect on LinkedIn

    November 10, 2020 at 3:39 pm #501861
    DJ Carl
    Participant

    Bianca,

    Here is a screenshot. The BOX, not the text needs to center on mobile.

    Thanks

    November 10, 2020 at 4:09 pm #501865
    Bianca
    Participant

    Hi Carl,
    Sorry, I overlooked that it was a mobile issue. This might help to center the box.
    Replace this:
    margin: 10px;

    with this:
    margin: 10px auto;

    When you add just one value it applies this for all sides top - right - bottom - left. When you add two values, the first applies vertically (top and bottom) and the second value applies horizontally (right and left). The auto value makes it align in the middle of the section. More information about this can be read here.
    https://developer.mozilla.org/en-US/docs/Web/CSS/margin


    I am a Marketing Communications specialist at Communics.

    Visit my personal website | Follow me on Twitter | Connect on LinkedIn

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘How to center CSS responsive Box-Sizing’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble