How to remove left and right margin on first and last div

Tags: css,css3

Problem :

I have more than 100 divs on the page and each row has 3 divs. I want to remove left margin from first div and right margin from right div whereas center div should have 15px margin from left and right. Please guide me how can I do that without giving specific classes (no margin) on each div. Here is the example

enter image description here here is my css code

    margin:15px 15px;

Solution :

Check this out :

Use nth-child(n) CSS3 selector.

    CSS Howto..

    How to import the css file by media queries by condition [duplicate]

    How can I adjust my thumbnail which exceeds its designated area?

    How to create multiple columns in a div

    How to detect whether a browser has tap highlighting?

    How can I create a CSS “well” effect similar to bootstap but deeper?

    how to scroll down|up animatedly in jquery css?

    How to make text “Passed” and progress bar appear in line in smaller views?

    How to dynamically create two rows of squares in html/css/javascript

    How to prevent dynamically appended div from overflowing?

    How to style a video iFrame?

    How to use bootstrap-theme.css with bootstrap 3?

    how to add scroller for one div, 2 divs always visible

    How to style button inputs to be identical in Chrome and Firefox?

    How to add fade in and fade out effect in CSS animations no javascript?

    How to use sprite css [duplicate]

    How to add two lines of text inside a DIV

    How to create a card flip effect on DIV using javascript

    How to stylize left part of input range in Metro Apps?

    Bootstrap css, how to make always visible navbar-toggle?

    CSS can't be overwritten, no matter how ; Wordpress with responsive style_options.php

    How to make a horizontal scroll when minifying window?

    How to create this type of window,as described in the attached picture with HTML,CSS? [closed]

    How to get Mouse Out effect in CSS

    How to make rounded corner cut-out using CSS?

    How to make space visible in between an unsorted list in HTML/CSS?

    How do I correctly fromat this div's contents?

    How to show a notification bar on Top after n seconds with transition from top to down?

    How to run multiple css selector classes at once?

    How to Wrap Text Within an Image-Link? HTML CSS

    How do you change the theme and colors of Site.Master in ASP.NET / C#?