- This topic is empty.
-
AuthorPosts
-
February 4, 2014 at 10:58 am #161836
Dromascott
ParticipantI’ve tailored this CSS Photo Gallery for my webpage but cannot get the ‘polaroids’ to center. I tried putting the whole section within a div and centering it but that didn’t work. Not sure where I’m going wrong here. Still very new at programming, so thanks in advance.
(http://www.themusicshop.com/lessonmain2.asp “Music Shop Performing Arts Center”)
(http://codepen.io/anon/pen/oxyAd “CodePen”)
February 4, 2014 at 11:04 am #161837chrisburton
ParticipantI think you might want to start over. A lot of your markup and CSS will cause issues for you and is inefficient.
February 4, 2014 at 11:07 am #161839Dromascott
ParticipantWhich part of the CSS? Can you be more specific?
February 4, 2014 at 11:34 am #161840chrisburton
ParticipantIs it completely necessary to use a grid system?
This will fix the issue:
.span-18 { width: 710px; margin: 0 auto; }
And
.container { position: relative; display: inline-block; font-size: 0; }
February 4, 2014 at 11:41 am #161843Dromascott
ParticipantWell to be honest I’m not sure but, i love the way this gallery looks and functions. I need something editable and a bit interactive. If i can get them to the center that would great.
February 4, 2014 at 11:42 am #161844Soren
ParticipantThe div that contains the images has a class “column”. This class uses float: left and margin-right: 10px
You’d want float:none and margin-right: 0 for the specific div you want centred.
Edit: Or just remove the class “column” from the containing div and add a “clearfix” class!
February 4, 2014 at 11:47 am #161845chrisburton
ParticipantExcept that you’re using
<br>
tags like crazy. You’re using multiple divs to align things that could simply be done with a single element (wrap class). A lot of your markup is just not necessary.February 4, 2014 at 12:04 pm #161853Dromascott
ParticipantUnderstood. I will work on cleaning up once i fix the centering issue. I’m still new at programming and learning on the go so I know my code is sloppy. Thanks guys
February 4, 2014 at 12:09 pm #161854Soren
ParticipantHey did you not see this?
February 4, 2014 at 12:21 pm #161855Dromascott
ParticipantYep I did. Thanks Soren
February 4, 2014 at 1:12 pm #161860Dromascott
ParticipantFixed! Thank you very much. So basically it was column within a column and both were floating left?
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.