restrict sidebar only to home page

  • Author
    Posts
  • #1340333

    hobnobnoor
    Member

    Hi!

    My sidebar keeps showing on every page,I want to restrict it only to my home page,how can I do that?

    The blog I need help with is letstrycreating.com.

    #1340477

    timethief
    Member

    This thread will be moved to the CSS Forum for you. Please do not create a duplicate thread.

    #1340520

    hobnobnoor
    Member

    ok thank you!

    #1340601

    One way would be to hide it everywhere and then unhide it using the “.home” body class selector.

    Here is a basic example:

    #secondary {
    	display: none;
    }
    
    .home #secondary {
    	display: block;
    }

    Try coming up with the CSS you would need to adjust the width of the main content column with a similar set of code.

    To learn more about CSS, start here!
    http://www.htmldog.com/guides/cssbeginner/

    #1340649

    hobnobnoor
    Member

    Thank you! by width of main content column which area do you exactly mean? as I am discovering the right design for my website and CSS commands both at the same time and same pace !!!

    #1340655

    You’re doing great!

    by width of main content column which area do you exactly mean?

    Check out this example. It shows the web inspector in the Chrome browser. To find it, I right-clicked on the main content area on the http://letstrycreating.com/tutorials/ page then I looked in the HTML panel on the left until I found the container for the content. When you click on the container HTML element on the left, you will see all of the CSS that applies to the element you clicked on in the right panel. So, in this example, you can see how the theme has used the “.content-area” selector and set the width to 42.7451%

    http://cl.ly/QC1L

The topic ‘restrict sidebar only to home page’ is closed to new replies.