Solved

Divide <div> tag to 3 rows

Posted on 2016-07-30
9
33 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
ID: 41735495
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
ID: 41735761
you could use css3 column

see this

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

Expert Comment

by:Branislav Borojevic
ID: 41735876
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
ID: 41735894
But you have used class="col-md-12" ,i think it is from bootstrap, i don't use bootstrap.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:MOSTAGHASSI
ID: 41735896
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
ID: 41735898
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
ID: 41735901
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
ID: 41735904
Thanks, Branislav Borojevic, but these are 3 separate div where is their container (  <div class="row">)?
0
 
LVL 4

Expert Comment

by:Branislav Borojevic
ID: 41735906
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

20 Experts available now in Live!

Get 1:1 Help Now