WordPress.org

Ready to get started?Download WordPress

Forums

Does the css class for a sidebar always need to be named sidebar? (5 posts)

  1. gezzamondo
    Member
    Posted 1 year ago #

    ive currently created a template for my homepage and ive named the divs that are side by side:

    <div class="home-left" ></div>
    <div class="sidebar-right"></div>

    the css for both is:

    .home-left {
    	width:630px;
    	background-color:#F90;
    	float:left;
    }
    .sidebar-right {
    	width:300px;
    	background-color:#666666;
    	height:500px;
    	float:left;
    }

    but if i change the name of the sidebar div to 'home-right' and change the css to:

    .home-right {
    	width:300px;
    	background-color:#666666;
    	height:500px;
    	float:left;
    }

    it completely disappears.... does the css class for the div need to have sidebar in the name??

    im total confused

  2. patv
    Member
    Posted 1 year ago #

    Depending how you've got your theme setup (is it a child theme or are you modifying the current theme?), then yes there may be some css rules that are defining the structure of your sidebar (through .sidebar-right). Best you don't remove the existing ids and classes defined in the markup, but if you really want to defined a .home-right for the div, add it as a second class to the div:

    <div class="home-left" ></div>
    <div class="sidebar-right home-right"></div>
  3. gezzamondo
    Member
    Posted 1 year ago #

    im using the starkers theme so there are no divs, im creating them all from scratch

  4. patv
    Member
    Posted 1 year ago #

    Perhaps .sidebar-right is already defined in a parent CSS rule. Do you have access to firebug to check if there are any styling that would be hiding the sidebar when you rename the sidebar class to .home-right?

  5. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    please post a link to the live site to illustrate the issue.

Topic Closed

This topic has been closed to new replies.

About this Topic