Solved

Divide <div> tag to 3 rows

Posted on 2016-07-30
9
31 Views
Last Modified: 2016-07-30
Hello, i want to divide a div tag to 3 rows in css,please let me know its codes.
Thanks
0
Comment
Question by:MOSTAGHASSI
9 Comments
 
LVL 3

Accepted Solution

by:
Lisa Miller earned 250 total points
Comment Utility
Yes you can use this code
 
<div class="col-lg-12"><div class="col-sm-4"></div><div class="col-sm-4"></div><div class="col-sm-4"></div></div>
0
 
LVL 6

Expert Comment

by:Manuel Marienne-Duchêne
Comment Utility
you could use css3 column

see this

http://www.w3schools.com/css/css3_multiple_columns.asp
0
 
LVL 4

Expert Comment

by:Branislav Borojevic
Comment Utility
If you want to have three different rows within the div, you can use what Lisa has suggested, but rather add three col-md-12 inside of a div.

<div class="row">
  <div class="col-md-12">Column 1 - full width, represents a row</div>
  <div class="col-md-12">Column 2 - full width, represents a row</div>
  <div class="col-md-12">Column 3 - full width, represents a row</div>
</div>

Open in new window

0
 

Author Comment

by:MOSTAGHASSI
Comment Utility
But you have used class="col-md-12" ,i think it is from bootstrap, i don't use bootstrap.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:MOSTAGHASSI
Comment Utility
I use DW CC 2015 , and i found it has some bootstrap components like Container,can i use it as div?
0
 
LVL 4

Expert Comment

by:Branislav Borojevic
Comment Utility
You can call them any way you want.

<div class="row">
  <div class="column-full-width">Column 1 - full width, represents a row</div>
  <div class="column-full-width">Column 2 - full width, represents a row</div>
  <div class="column-full-width">Column 3 - full width, represents a row</div>
</div>

Open in new window


The point is to add a CSS statement that would make that class 100% width of the row, so that they would stack
0
 
LVL 4

Assisted Solution

by:Branislav Borojevic
Branislav Borojevic earned 250 total points
Comment Utility
Try something like this:

<html>
<head>
<style>
.column-full-width {
    -webkit-column-width: 100%; /* Chrome, Safari, Opera */
    -moz-column-width: 100%; /* Firefox */
    column-width: 100%;
    width:100%;
    margin-bottom:15px;
    background:#e1e1e1;
}
</style>
</head>
<body>
<div class="column-full-width">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius.
</div>
<div class="column-full-width">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius.
</div>
<div class="column-full-width">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius.
</div>
</body>
</html>

Open in new window

0
 

Author Comment

by:MOSTAGHASSI
Comment Utility
Thanks, Branislav Borojevic, but these are 3 separate div where is their container (  <div class="row">)?
0
 
LVL 4

Expert Comment

by:Branislav Borojevic
Comment Utility
My bad, just put them inside a div and that should do it.

I omitted the <div class="row"> accidentally. Just wrap these divisions within another div and you should be good to go. Also, add CSS width to that row class.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now