title: Setting two <divs> next to each other horizontally
body: <p>I'm trying to set two  next to each other. I tried code from this question: <a href="https://stackoverflow.com/questions/446060/css-two-divs-next-to-each-other">CSS two divs next to each other</a> but nothing works.</p>
  
  <p>This is my code</p>
  
  <p><strong>profile.css:</strong></p>
  
  <pre><code>#content {
  
      width: 100%;
  
  }
  
  #profile-image {
  
      float: left;
      display: inline-block;
  
  
  }
  
  #profile-details {
  
  
  
      float: right;
      display: inline-block;
      margin-left: 200px;
  
  
  }
  </code></pre>
  
  <p><strong>UserProfile.aspx:</strong></p>
  
  <pre><code>&lt;%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="UserProfile.aspx.vb" Inherits="UserProfile" %&gt;
  
  &lt;asp:Content ID="Content1" runat="server" contentplaceholderid="ContentPlaceHolder1"&gt;
  
      &lt;link rel="stylesheet" href="profile.css" type="text/css"  /&gt;
  
      &lt;div id="content"&gt;
          &lt;div id="profile-image"&gt;
              &lt;asp:Image ID="Image1" runat="server" Height="191px" Width="128px" /&gt;
  
              &lt;br /&gt;
              &lt;br /&gt;
              Upload picture:
              &lt;asp:FileUpload ID="profImageUpload" runat="server" /&gt;
              &lt;br /&gt;
              &lt;br /&gt;
              &lt;br /&gt;
              &lt;br /&gt;
              &lt;br /&gt;
          &lt;/div&gt;
  
          &lt;div id="profile-details"&gt;
  
  
              &lt;asp:Table ID="Table1" runat="server"&gt;
              &lt;/asp:Table&gt;
              asdafasf
  
  
  
          &lt;/div&gt;
  
      &lt;/div&gt;
  
      &lt;div&gt;&lt;/div&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p><strong>style.css:</strong></p>
  
  <pre><code>body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, textarea, p, blockquote, th, td {
      margin: 0 297px 0 137px;
      padding: 0;
  }
  table {
      border-collapse: collapse;
      border-spacing: 0;
  }
  fieldset, img {
      border: 0;
  }
  address, caption, cite, code, dfn, em, strong, th, var {
      font-style: normal;
      font-weight: 700;
      font-size: medium;
  }
  ol, ul {
      list-style: none;
  }
  caption, th {
      text-align: left;
  }
  h1, h2, h3, h4, h5, h6 {
      font-size: 100%;
      font-weight: normal;
  }
  q:before, q:after {
      content: '';
  }
  abbr, acronym {
      border: 0;
  }
  header, nav, section, article, aside, footer {
      display: block;
  }
  body {
      font: 12px/18px Arial, Tahoma, Verdana, sans-serif;
      width: 100%;
      background-image: url(../images/Images/background-large.png);
      background-repeat: repeat-x repeat-y;
  }
  a {
      color: blue;
      outline: none;
      text-decoration: underline;
  }
  a:hover {
      text-decoration: none;
  }
  /* Begin of styles for the demonstration (you can remove them) */
  a.expand {
      width: 150px;
      display: block;
      margin: 10px 0 0;
  }
  a.expand:hover {
      height: 500px;
  }
  /* End of of styles for the demonstration */
  p {
      margin: 0 0 18px;
      width: 386px;
      height: 55px;
  }
  img {
      border: none;
  }
  input {
      vertical-align: middle;
  }
  #wrapper {
      width: 1000px;
      margin: 0 auto;
  }
  
  
  /* Header
  -----------------------------------------------------------------------------*/
  #header {
      margin-top: 25px;
      height: 39px;
      background-color: #D1D1D1;
      width: 899px;
  }
  
  
  .navigation-menu, .menu ul, .menu li, .menu a {
      margin: 0;
      padding: 0;
      border: none;
      outline: none;
      margin-top: 2px;
      margin-bottom: 50px;
  
  
  }
  
  .navigation-menu {
      height: 40px;
      width: 550px;
  
      background: #4c4e5a;
      background: -webkit-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
      background: -moz-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
      background: -o-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
      background: -ms-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
      background: linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
  
      -webkit-border-radius: 5px;
      -moz-border-radius: 5px;
      border-radius: 5px;
  }
  
  .navigation-menu li {
      position: relative;
      list-style: none;
      float: left;
      display: block;
      height: 40px;
      z-index: 1;
  
  
  
  }
  
  .navigation-menu li a {
      display: block;
      padding: 0 14px 0 30px;
      margin: 6px 0;
      line-height: 28px;
      text-decoration: none;
  
      border-left: 1px solid #393942;
      border-right: 1px solid #4f5058;
  
      font-family: Helvetica, Arial, sans-serif;
      font-weight: bold;
      font-size: 13px;
  
      color: #f3f3f3;
      text-shadow: 1px 1px 1px rgba(0,0,0,.6);
  
      -webkit-transition: color .2s ease-in-out;
      -moz-transition: color .2s ease-in-out;
      -o-transition: color .2s ease-in-out;
      -ms-transition: color .2s ease-in-out;
      transition: color .2s ease-in-out;
  }
  
  .navigation-menu li:first-child a {
  border-left: none;
  }
  .navigation-menu li:last-child a{
  border-right: none;
  }
  
  .navigation-menu li:hover &gt; a {
  color: #8fde62;
  }
  
  .navigation-menu ul {
      position: absolute;
      top: 40px;
      left: 0;
  
  
      opacity: 0;
      background: #1f2024;
  
      -webkit-border-radius: 0 0 5px 5px;
      -moz-border-radius: 0 0 5px 5px;
      border-radius: 0 0 5px 5px;
  
      -webkit-transition: opacity .25s ease .1s;
      -moz-transition: opacity .25s ease .1s;
      -o-transition: opacity .25s ease .1s;
      -ms-transition: opacity .25s ease .1s;
      transition: opacity .25s ease .1s;
  
  }
  
  .navigation-menu li:hover &gt; ul { opacity: 1; }
  
  .navigation-menu ul li {
      height: 36px;
      overflow: hidden;
      padding: 0;
  
      -webkit-transition: height .25s ease .1s;
      -moz-transition: height .25s ease .1s;
      -o-transition: height .25s ease .1s;
      -ms-transition: height .25s ease .1s;
      transition: height .25s ease .1s;
  }
  
  .navigation-menu li:hover &gt; ul li {
      height: 36px;
      overflow: visible;
      padding: 0;
  
  }
  
  .navigation-menu ul li a {
      width: 100px;
      padding: 4px 0 4px 40px;
      margin: 0;
  
      border: none;
      border-bottom: 1px solid #353539;
  }
  
  .navigation-menu ul li:last-child a {
  border: none;
  }
  
  .navigation-menu a.documents { background: url(../images/Icons/document.png) no-repeat 6px center; }
  .navigation-menu a.messages { background: url(../images/Icons/mail.png) no-repeat 6px center; }
  .navigation-menu a.settings { background: url(../images/Icons/settings.png) no-repeat 6px center; }
  .navigation-menu a.home { background: url(../images/Icons/home.png) no-repeat 6px center; }
  .navigation-menu a.profile { background: url(../images/Icons/profile.png) no-repeat 6px center; }
  .navigation-menu a.mainsettings { background: url(../images/Icons/settings.png) no-repeat 6px center; }
  .navigation-menu a.docs{ background: url(../images/Icons/document.png) no-repeat 6px center; }
  .navigation-menu a.others { background: url(../images/Icons/movie.png) no-repeat 6px center; }
  .navigation-menu a.uploads { background: url(../images/Icons/upload.png) no-repeat 6px center; }
  .navigation-menu a.profile { background: url(../images/Icons/user.png) no-repeat 6px center; }
  .navigation-menu a.projects { background: url(../images/Icons/stamp.png) no-repeat 6px center; }
  .navigation-menu a.yprojects { background: url(../images/Icons/stamp.png) no-repeat 6px center; }
  .navigation-menu a.otherprojects { background: url(../images/Icons/stamp.png) no-repeat 6px center; }
  
  
  
  
  /* Middle
  -----------------------------------------------------------------------------*/
  #middle {
      /*border-left: 250px solid #B5E3FF;
      border-right: 250px solid #FFACAA;*/
      height: 1%;
      position: relative;
  }
  #middle:after {
      content: '';
      clear: both;
      display: table;
  }
  #container {
      width: 100%;
      float: left;
      overflow: hidden;
      margin-right: -100%;
  }
  #content {
  
      padding: 75px 20px;
      background-color: #D1D1D1;
  }
  
  
  
  
  /* Footer
  -----------------------------------------------------------------------------*/
  #footer {
  
      margin-top: 50px;
      height: 25px;
      background: #D1D1D1;
  }
  
  #login {
  
      margin-top: 10px;
      width: 899px;
      background-color: #909090;
      padding-left: 10px;
      padding-top: 10px;
      padding-bottom: 1px;
  
  }
  
  #login-form {
  
      background-color: #909090;
      width: 899px;
  
  
  }
  </code></pre>
  
  <p>How it currently looks:
  <img src="https://i.stack.imgur.com/13MXE.png" alt="enter image description here"></p>
  
  <p><strong>EDIT:</strong> The Code in the MasterPage has changed, my pages are now displayed like this:</p>
  
  <p><img src="https://i.stack.imgur.com/vCLKi.png" alt="enter image description here"></p>
  
  <p><strong>MasterPage.aspx:</strong></p>
  
  <pre><code>&lt;%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %&gt;
  &lt;%@ Import Namespace="System.Data.SqlClient" %&gt;
  &lt;!DOCTYPE html&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;script runat="server"&gt;
  
  
  
      Protected Sub Page_Load(sender As Object, e As EventArgs)
  
          If Session("userid") = Nothing Then
              txtLoginUser.Visible = True
              txtLoginPass.Visible = True
  
          Else
  
  
              Dim conn As New SqlConnection("Data Source=BRIAN-PC\SQLEXPRESS;Initial Catalog=master_db;Integrated Security=True")
              Dim useridComm As String = "SELECT name, surname FROM users WHERE user_id=@userid"
              Dim sqlUserID As New SqlCommand
  
              conn.Open()
  
              Dim userid As String = Session("userid")
  
              sqlUserID = New SqlCommand(useridComm, conn)
              sqlUserID.Parameters.AddWithValue("@userid", userid)
              Dim datareader As SqlDataReader = sqlUserID.ExecuteReader()
              If datareader.HasRows Then
  
                  FormsAuthentication.RedirectFromLoginPage(datareader("user_id"), True)
                  lblLoggedIn.Text = datareader("name").ToString() &amp; " " &amp; datareader("surname").ToString()
  
              End If
              datareader.Close()
              conn.Close()
  
          End If
      End Sub
  
     Protected Sub Button1_Click(sender As Object, e As EventArgs)
  
          Dim loginSQL As New SqlCommand
          Dim loginComm As String
  
          Dim CommonFunctions As New CommonFunctions()
          Dim dec_pass As String = CommonFunctions.EncryptPassword(txtLoginPass.Text.Trim)
  
          Dim conn As New SqlConnection("Data Source=BRIAN-PC\SQLEXPRESS;Initial Catalog=master_db;Integrated Security=True")
  
  
          loginComm = "SELECT user_id FROM users WHERE username=@username and password=@password"
  
          conn.Open()
  
  
          loginSQL = New SqlCommand(loginComm, conn)
          loginSQL.Parameters.AddWithValue("@username", txtLoginUser.Text.ToString)
          loginSQL.Parameters.AddWithValue("@password", dec_pass)
          Dim dr As SqlDataReader = loginSQL.ExecuteReader()
          dr.Read()
  
  
          If dr.HasRows Then
              Session("userid") = dr("user_id")
          ElseIf dr.HasRows = False Then
  
              lblRegister.ForeColor = Drawing.Color.Red
              lblRegister.Text = "Incorrect Username/Password."
          End If
          dr.Close()
          conn.Close()
  
      End Sub
  
  
  
  
  
  &lt;/script&gt;
  
  
  
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"&gt;&lt;/script&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;meta name="keywords" content="" /&gt;
      &lt;meta name="description" content="" /&gt;
      &lt;link rel="stylesheet" href="style.css" type="text/css" media="screen, projection" /&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
      &lt;form id="form1" runat="server"&gt;
  
  &lt;div id="wrapper"&gt;
  
      &lt;header id="header"&gt;
          &lt;strong&gt;Header:&lt;/strong&gt; Mobile CMS
  
          &lt;/header&gt;
  
  
  &lt;section id="login"&gt;
  
      &lt;div id="login-form"&gt;
  
           &lt;p&gt;
  
                      &lt;asp:Label ID="lblUsername" runat="server" Font-Bold="True" Text="U:"&gt;&lt;/asp:Label&gt;
  &amp;nbsp;&lt;asp:TextBox ID="txtLoginUser" runat="server" BorderStyle="None" BorderWidth="0px" Wrap="False"&gt;&lt;/asp:TextBox&gt;
  &amp;nbsp;
                      &lt;asp:Label ID="lblUsername0" runat="server" Font-Bold="True" Text="P:"&gt;&lt;/asp:Label&gt;
                      &lt;asp:TextBox ID="txtLoginPass" runat="server" BorderStyle="None" BorderWidth="0px" TextMode="Password" Wrap="False"&gt;&lt;/asp:TextBox&gt;
  &amp;nbsp;
                      &lt;asp:Button ID="btnLogin" runat="server" BorderStyle="None" OnClick="Button1_Click" Text="Login" /&gt;
  
                  &lt;/p&gt;
  
                  &lt;p&gt;
  
                      &lt;asp:Label ID="lblRegister" runat="server" Font-Bold="True" Font-Underline="True" ForeColor="#0000CC" Text="Register"&gt;&lt;/asp:Label&gt;
  
                      &lt;asp:Label ID="lblLoggedIn" runat="server"&gt;&lt;/asp:Label&gt;
  
                  &lt;/p&gt;
           &lt;p&gt;
  
                      &amp;nbsp;&lt;/p&gt;
  
  
  
      &lt;/div&gt;
  
  &lt;/section&gt;
  
  &lt;div class="navigation-bar"&gt;
         &lt;ul class="navigation-menu"&gt;
  
              &lt;li&gt;&lt;a href="#" class="home"&gt;Home&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#" class="mainsettings"&gt;Settings&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#" class="profile"&gt;Profile&lt;/a&gt;
  
                  &lt;ul&gt;
                      &lt;li&gt;&lt;a href="#" class="messages"&gt;Messages&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="#" class="settings"&gt;Profile Settings&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
  
              &lt;/li&gt;
              &lt;li&gt;&lt;a href="#" class="uploads"&gt;Uploads&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#" class="documents"&gt;Media&lt;/a&gt;
  
  
                  &lt;ul&gt;
                      &lt;li&gt;&lt;a href="#" class="docs"&gt;Documents&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="#" class="others"&gt;Others&lt;/a&gt;&lt;/li&gt;
  
                  &lt;/ul&gt;
  
              &lt;/li&gt;
  
              &lt;li&gt;&lt;a href="#" class="projects"&gt;Projects&lt;/a&gt;
  
  
                  &lt;ul&gt;
                      &lt;li&gt;&lt;a href="#" class="yprojects"&gt;Your Projects&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="#" class="otherprojects"&gt;Other Projects&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
  
              &lt;/li&gt;
  
          &lt;/ul&gt;
  
      &lt;/div&gt;
  
  
      &lt;section id="middle"&gt;
  
          &lt;div id="container"&gt;
  
              &lt;asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"&gt;                       
  
              &lt;/asp:ContentPlaceHolder&gt;
  
          &lt;/div&gt;
  
      &lt;/section&gt;
  
      &lt;footer id="footer"&gt;
          &lt;strong&gt;Footer:&lt;/strong&gt; adsfdsgfds
      &lt;/footer&gt;
  
  &lt;/div&gt;
  
      &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>