Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Divide <div> tag to 3 rows

Posted on 2016-07-30
9
42 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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
 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

856 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