Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6244091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:15:52+00:00 2026-05-24T12:15:52+00:00

I am having some trouble with DIVs in regards to laying them side by

  • 0

I am having some trouble with DIVs in regards to laying them side by side. An image will help.

I need to have the red box (or anything else i like) into the green outlined area. I want to try avoid things like float:left; since it ruins the formatting of the navigation bar.

I have tried using span tags around the navigation bar, using a specific amount of pixels to the left (which didn’t work, and I don’t like doing that anyway).

Please keep in mind I’m a beginner and therefore inexperienced.

http://imageshack.us/photo/my-images/12/webjd.jpg/

html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
<link href="navigation.css" rel="stylesheet" type="text/css" />
</head>

<body>
    <div class="page">
        <img id="header" alt="Banner" longdesc="Text Here" src="rsc/banner_phone.jpg"/>

        <div class="sidebar">
            <ul class="navigation">
                <li class="current"><a href=""><em class="home"></em><b>Homepage</b></a></li><br /><br />
                <li><a href=""><em class="templates">           </em><b>Homepage</b></a></li><br /><br />
                <li><a href="d"><em class="psd">                </em><b>Homepage</b></a></li><br /><br />
                <li><a href=""><em class="tutorials">           </em><b>Homepage</b></a></li><br /><br />
                <li><a href=""><em class="shop">                </em><b>Homepage</b></a></li><br /><br />
                <li><a href=""><em class="contact">             </em><b>Homepage</b></a></li><br /><br />
            </ul>                                       
        </div>

        <div class="main">
            <p>sdfds</p>
        </div>

    </div>
</body>


</html>


css:

    /* PAGE CONTAINERS */
        /* Background Color */
    body {
        background:#CCCCCC
    }

    .page {
        width:80%;
        margin-left:10%;
        background-color:white;
        box-shadow: 4px 4px 4px #000000;
    }

    .main {
        position:absolute;
        left:180px;
        background-color:red;
    }

    /* NAVIGATION ELEMENTS */

    #header {
    width:100%;
    height:185px;
    }

    .navigation {
        padding:3px 0 3px 0;
        margin:0;
        list-style:none;background-color:#DDDDDD;
    width:180px;
    height:100%;

        }

    .navigation li a {
        float:left;
        height:40px;
        line-height:40px;
        text-decoration:none;
        font-family:arial, verdana, sans-serif;
        text-align:center;
        padding:0 0 0 10px;
        font-size:11px;
    }
    .navigation li a b {
        float: left;
        display: block;
        padding: 0 20px 0 8px;
    }
    .navigation li.current a {
        color:#0000FF;
        font-weight: bold;
            font-size:13px;
    }
    .navigation li a:hover {
        color:#0000FF;
     padding: 0 0px 0 20px;
     }
    .navigation li a em {
        display:block;
        float:left;
        width:30px;
        height:40px;
    }

    /* ICON ELEMENTS */

    .navigation li a em.home {
        background-image: url(http://www.hv-designs.co.uk/tutorials/css_navigation2/nav_icons/home.png);
        background-repeat: no-repeat;
        background-position: center center;
    }
    .navigation li a em.templates {
        background-image: url(http://www.hv-designs.co.uk/tutorials/css_navigation2/nav_icons/templates.png);
        background-repeat: no-repeat;
        background-position: center center;
    }
    .navigation li a em.psd {
        background-image: url(http://www.hv-designs.co.uk/tutorials/css_navigation2/nav_icons/psd.png);
        background-repeat: no-repeat;
        background-position: center center;
    }
    .navigation li a em.tutorials {
        background-image: url(http://www.hv-designs.co.uk/tutorials/css_navigation2/nav_icons/tutorials.png);
        background-repeat: no-repeat;
        background-position: center center;
    }
    .navigation li a em.shop {
        background-image: url(http://www.hv-designs.co.uk/tutorials/css_navigation2/nav_icons/shop.png);
        background-repeat: no-repeat;
        background-position: center center;
    }
    .navigation li a em.contact {
        background-image: url(http://www.hv-designs.co.uk/tutorials/css_navigation2/nav_icons/contact.png);
        background-repeat: no-repeat;
        background-position: center center;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:15:53+00:00Added an answer on May 24, 2026 at 12:15 pm

    What you can do is add the css property as follows to the 2 div's you want to display on the same line:

    display: inline-block;
    

    So you would add this to the sidebar and the green box (in your image).

    Remember though that this is not considered good practice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble properly positioning some divs within a larger div and having them
Having some trouble overriding ActionBarSherlock styles, hopefully someone can help. I have created a
I'm having some trouble finding the way to create 3 DIVs side by side,
Having a bit of trouble here. I have 4 DIVs. I want them to
Im having some trouble writing a getstring function, this is what I have so
Im having some trouble getting the syntax right. I have a movie clip that
I'm having some trouble writing a function to change a background image on a
I'm having some trouble writing a jQuery function and could use a little help.
I'm having some trouble with adding tips to a Request.HTML function. I have a
I'm trying to switch randomly some images within 4 divs, but I'm having trouble

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.