Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use div to layout page

I am using div to layout a page. The page has two columns. The first column is a map. The second column contains three rows of graphs. I used the code below. The result gives me just one column (instead of two) with four rows. What am I doing wrong?

<!-- This is where the map will live -->    
<div id="map-container" style="width:1000px; height:500px"></div>

<!-- CHARTS!!! -->

<div class="row">

    <!-- row chart -->
    <div class="col-md-1">
        <div id="rowchart2" class="dc-chart"></div>
        <center><div class="title">Severity</div></center>
    </div>

    <!-- Histogram-->
    <div class="col-md-2 col-md-offset-1">
        <div id="rowchart" class="dc-chart"></div>
        <center><div class="title">Histogram(Delta Speed)</div></center>
    </div>

    <!-- row chart -->
    <div class="col-md-4 col-md-offset-0">
        <div id="rowchart3" class="dc-chart"></div>
        <center><div class="title">Direction</div></center>     
    </div>                  
</div>
like image 277
Free Man Avatar asked Dec 15 '14 14:12

Free Man


People also ask

What is div layout?

HTML Div Based LayoutUsing the <div> elements is the most common method of creating layouts in HTML. The <div> (stands for division) element is used for marking out a block of content, or set of other elements inside an HTML document. It can contain further other div elements if required.

How do you structure a div in HTML?

The <div> tag defines a division or a section in an HTML document. The <div> tag is used as a container for HTML elements - which is then styled with CSS or manipulated with JavaScript. The <div> tag is easily styled by using the class or id attribute. Any sort of content can be put inside the <div> tag!

How do you split a website layout?

A website can be divided into various sections comprising of header, menus, content and footer based on which there are many different layout design available for developer. Different layouts can be created by using div tag and use CSS property to style it.


1 Answers

<div class="row">

    <div class="col-md-12">
        <div class="col-md-6">
            Column 1:


            <div id="map-container" class="col-md-12" style="width:100%; height:500px"></div>


        </div>

        <div class="col-md-6">


            OTHER DATA HERE

        </div>
    </div>


</div>
like image 68
Dawood Awan Avatar answered Oct 01 '22 18:10

Dawood Awan