Solved

Css to add margin to column

Posted on 2013-06-26
3
383 Views
Last Modified: 2013-06-26
I have this newspaper style column in css but I would like to add equal margin in left and right so it would center the 3 columns. right now it looks wide.
I applied it in a DIV in HTML. Should I need another DIV on top of this DIV to add the margin.
Please add the code necessary. thanks

.newspaper3
{
-moz-column-count:3; /* Firefox */
-webkit-column-count:3; /* Safari and Chrome */
column-count:3;
0
Comment
Question by:zachvaldez
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
lightspeedvt earned 225 total points
ID: 39279538
No need to add more DIVs on top. Just assign some margins (for example 120px):
    margin-left:120px;
    margin-right:120px;

Open in new window


So, final CSS will be:
.newspaper3{
    -moz-column-count:3; /* Firefox */
    -webkit-column-count:3; /* Safari and Chrome */
    column-count:3;
    margin-left:120px;
    margin-right:120px;
}

Open in new window


Here is demo:
http://jsfiddle.net/2E3fp/
0
 

Author Comment

by:zachvaldez
ID: 39279559
That works perfect! What Id like to shift into is getting away from table structures-the td,tr,etc..
which I've previously use and instead use CSS with rows and cols that is controlled by DVs.
I'll be  creating a page with many labels and textboxes in rows and cols using css.
Im looking for examples to start to buld it.It is a registration page kinda , therefe=ore a a lot of info required with several kinds of controls in it.
Can yo provide an excellent layout to to start with?  Perhaps a few lines for rows and cols. thanks
0
 
LVL 6

Expert Comment

by:lightspeedvt
ID: 39279644
Seems that should be posted as another question, as I haven't excellent layout that will help you to start with.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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 demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

839 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