• Hi,

    I’m having difficulties aligning the page content (the text and pictures) on my site to the left. I’ve been checking through the style.css for anything that responds to the aligning of the content itself.

    Also, how do I decrease the gap between the header (which is just text basically) and the menu?

    https://www.deurellarkitekter.se is the site I’m working on, running with the TwentyEleven theme. I’ve edited the code itself and not created a, from what I hear is recommended, a child theme. Is this possible to do from where I am now, creating a child theme that is?

    I’m sorry if this has been posted somewhere else but I’ve searched any possible keywords for this and none seems to help.

    Thank you in advance for taking the time to read.

    Regards,
    Apachez

Viewing 4 replies - 16 through 19 (of 19 total)
  • Thread Starter apachez

    (@apachez)

    I wanted to remove nasty footer so what I did was I took the footer.php file from the parent theme, edited it on my harddrive, uploaded it into my child theme folder on the FTP and it worked! Is this how you do it? Can you delete entire lines of codes in your child theme, since it will overwrite the parent one?

    Ok,

    The problem I am having understanding this child theme, is that I just write the lines I want to be changed.

    Stylesheet

    That is correct only for the stylesheet style.css, because in the child themes style.css only need to write the bits we want to change.

    Twenty Eleven Style we do not edit:

    #access {
    	background: #222; /* Show a solid color for older browsers */
    	background: -moz-linear-gradient(#252525, #0a0a0a);
    	background: -o-linear-gradient(#252525, #0a0a0a);
    	background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#252525), to(#0a0a0a)); /* older webkit syntax */
    	background: -webkit-linear-gradient(#252525, #0a0a0a);
    	-webkit-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
    	-moz-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
    	box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
    	clear: both;
    	display: block;
    	float: left;
    	margin: 0 auto 6px;
    	width: 100%;
    }

    In the Child Theme style.css we want to change just the background:

    #access {
    	background: #fff;
    }

    If we then view our navigation bar using FireFox and the FireBug addon, we will see that the parents style is in strikethrough font.

    FireFox and Firebug image

    https://digitalraindrops.net/images/menu-bug.png

    Pages and Template Parts
    Now if we wanted to change a template or page file like index.php we do not edit the file in the parent themes folder, we copy the file or open and save as in our child themes folder, and we then modify the file in the child theme, leaving the parent file as un-edited.

    functions.php
    We use functions.php in the child theme to overwrite parent theme functions and add any new theme functions.

    It can take a while to get your head around it, but it is worth it.

    My website is a twenty eleven child theme.

    HTH

    David

    Thread Starter apachez

    (@apachez)

    This is the code for the standard menu for Twenty Eleven

    [CSS moderated as per the Forum Rules.]

    How do I edit this so the background is white, active menu link is grey and nothing else in my child theme style.css? This is where it gets tricky, as I can get the background on the menu to be white, no problem, but how do I remove the rest of the strings of codes I don’t need? I always removed the lines I didn’t need before, now I need to make the child theme overwrite the parent code, which I can’t figure out.

    I’m sorry if I’m asking the same questions over and over again, just trying to get my head around it.

    Regards,
    Apachez

    Hi,
    You would not remove but over-ride and negate, here are some you can try to get you going.

    Zero all margins
    margin: 0;

    Then there are styles for each margin

    margin-top: 0;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;

    Some elements for padding and border.

    padding: 0;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 0;
    padding-right: 0;
    
    border: none;
    border-top: 0;
    border-bottom: 0;
    border-left: 0;
    border-right: 0;

    Hide an element:

    #site-title {
        display: none;
    }

    Use FireFox and the FireBug AddOn to find the styles, and study the parent css, it will all fall into place.

    Take a few minutes and watch this youtube
    https://www.youtube.com/watch?v=K4BafmxV5Wk
    https://www.youtube.com/watch?v=sHbYpl1XFiM
    https://www.youtube.com/watch?v=oe1nqI4fNRc

    HTH

    David

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘Aligning page content on TwentyEleven theme’ is closed to new replies.