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 6065175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:21:40+00:00 2026-05-23T09:21:40+00:00

I am learning HTML . I was reading the <div> tag in a book.

  • 0

I am learning HTML. I was reading the <div> tag in a book. I understand how it breaks the website into vertical pieces but I have also seen examples where people use <div> tag at the sidebar. How does the <div> tag work horizontally?

  • 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-23T09:21:41+00:00Added an answer on May 23, 2026 at 9:21 am

    To have them so they are side by side, you need to use CSS. A div element by default has the display property set to block. So therefore elements after it will usually appear below.

    To setup a couple columns lets say you have the following:

    <div class="container">
       <div class="left"></div>
       <div class="right"></div>
    </div>
    

    You can setup the columns by applying CSS rules to the classes:

    <style type="text/css">
        .container {
          width:500px;
        }
        .left {
          width:250px;
          float:left;
        }
        .right {
          width:250px;
          float:right;
        }
    </style>
    

    In short, im giving it a container to have a maximum width. It’s not required, but generally done this way. Then I set both divs to be half the width of the container, and i put float left on it. So all elements will stick beside it. The float right is optional. However, if you make the container wider, the right div will stick on the right hand side.

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

Sidebar

Related Questions

I am learning HTML and I have a good book to learn with but
I was reading O'Reilly's Learning XML Book and read the following HTML was in
I´ve just started learning GWT and I´m trying to implement http://gwt.google.com/samples/Showcase/Showcase.html#!CwFileUpload and but failing
learning html/css here. I can't seem to understand how to tweak this drop down
I know, I am crazy, considering I am literally just learning HTML. But I
I began learning html/css and throughout my learning I have seen the idea of
I am currently beginning my forays into HTML and CSS. Already I have become
I'm learning CSS and HTML. In my code I have: <style> table, td, th
I'm learning HTML & CSS and have built a page: http://customstudio.co.uk/development The page is
I've been learning about semantic HTML, and I keep reading how tags like <i>

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.