• Resolved ChrisColston

    (@chriscolston)


    Wondering if someine can help, I’m having terrible trouble centering some elements on my page:

    All I want is the logo and the main nav to be centered, and for mobile devices aswell? The theme has a custom CSS box but nothing seems to change when I alter the selectors. Can anyone help, I know it’s really basic, apologies

    thanks
    Chris

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hey there Chris,

    Hope you’re well! 🙂

    Something like this: http://prntscr.com/63q91m ? If so, I suggest you use a child theme http://codex.ww.wp.xz.cn/Child_Themes or use css custom plugin like this: https://ww.wp.xz.cn/plugins/simple-custom-css/ if you will customize your theme.

    Add the code in your child theme’s style.css or using the plugin mentioned above.

    #masthead {
    	position: relative;
    }
    
    div.site-branding {
    	width: 100%;
    }
    
    h1.site-title {
    	text-align: center;
    }
    
    #site-navigation {
    	width: 100%;
    }
    
    @media screen and (min-width: 1000px ) {
    	#social-icons {
    		position: absolute;
    		right: 0;
    	}
    }

    Let me know if it helps! 🙂

    Take care,
    Calvin

    P.S I notice that you are editing the styles when I also look at it so if you opt-in to my answer then I suggest you remove all modification to avoid conflict.

    Thread Starter ChrisColston

    (@chriscolston)

    Thanks Calvin, most helpful.

    I did try and use a child theme – the problem I have is that it only works if I use !important in all of the CSS overwrites. I know from experience that shouldn’t be the case I tried both the Wp_enque and @import setups but to no avail

    The logo is now centered, (slightly off on mobiles)

    My problem now is my text has defaulted back to a left alignment on desktop, I’ve tried getting a media query to work?? Could it be related to the issue abut the child theme not being picked up? I assume not

    thanks
    Chris
    http://madlife.co.uk/

    Thread Starter ChrisColston

    (@chriscolston)

    p.s I know this is pinecerty but I actually only want the h2 header to be as wide as the grid container

    For centering the main nav:

    #site-navigation li {
        float: none;
        display: inline-block;
    Thread Starter ChrisColston

    (@chriscolston)

    Cheers Jesin A

    Thread Starter ChrisColston

    (@chriscolston)

    closed

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘CSS Issue, basic help needed’ is closed to new replies.