Forums

[resolved] Cannot align two divs on homepage (4 posts)

  1. zaqedc
    Member
    Posted 4 months ago #

    I'm having a problem getting two div elements to line up side by side:

    I'm using a slider on my homepage.php called easySlider1.7.js to cycle through a couple of posts in a ceratain category.
    In conjunction with a file called slider.php, it generates a div element with an id of "slider", and is used in the homepage by calling:

    <?php include("slider.php"); ?>

    I have a sidebar I want to apply specifically to the homepage, called sidebar-homepage.php, consisting of just a few links, in its own div, called "sidebar-homepage". This is included directly under the call to the slider in homepage.php:

    <?php get_sidebar("homepage"); ?>

    No matter what I've tried so far, the sidebar always appears under the slider. Here is the css for the areas concerned:

    #slider li{
    	width:742px;
    	height:407px;
    	float: left;
    	list-style:none;
    	background:#4eb9d0;
    
    #sidebar-homepage{
    	float:left;
    	width:250px;
    	background:url(images/sidebarleft.png) no-repeat 0 0;
    	padding:20px;

    I have:
    - Tried specifying no float, float: left for both, and display: inline-block.
    - Set the width of both divs to 50px, to make sure one wasn't pushing the other out of alignment.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    Try using Firefox with the Firebug add-on for this kind of CSS work.
    http://getfirebug.com/

  3. zaqedc
    Member
    Posted 4 months ago #

    This does, in fact, appear to have been an issue with the width of the slider div. Apologies to anyone who wasted time read this!

    EDIT - I'll have a gander through firebug too, cheers Esmi!

  4. zaqedc
    Member
    Posted 4 months ago #

    To clarify further, it seems that the slider uses hidden divs, or something similar. I think the presence of these "additional" divs are what's pushing the sidebar out of alignment.

Reply

You must log in to post.

About this Topic