- This topic is empty.
-
AuthorPosts
-
March 14, 2015 at 3:41 am #198125
cscodismith
ParticipantI usually know how to do this just fine but in this case I don’t because my code here:
<div class="img-gallery"> <div class="gallery-photos"> <ul class="gallery-portfolio"> <?php $dirname = "uploads/"; $images = glob($dirname."*.png"); foreach($images as $image) { echo '<li><img src="'.$image.'" class="img-responsive" alt="Responsive image" /></li><br />';} ?> </ul> </div> </div>
This makes it so that all of the uploaded photos from my website will be added automatically but I am unsure with the tags I have there, how to style them the way I want. I have tried with multiple div’s and classes that I have surrounding the images with display: inline-block and display: block to try and make the images in a horizontal line but nothing has been changing effectively.
I know this may be hard to help me as I really can not make a codepen with the elements I have setup the way I do in my project as codepen doesn’t support php format. Thanks in advance for anyone that takes the time to help.
Best regards,
CodiMarch 14, 2015 at 7:22 am #198148Paulie_D
MemberThe PHP isn’t much use to us.
We need to see a reduced case demo of the output HTML & CSS (you can use dummy images if necessary) if you want layout and styling answers.
But gcyrillus is right…
br
tags are not mean to provide spacing between elements…that’s what margins & padding are for.If you need basic information on layout options I’d suggest you look at the
inline-block
and`float’ sections at http://learnlayout.com/March 14, 2015 at 1:47 pm #198172cscodismith
ParticipantWow not sure why I even had the break there, sorry about that – removing the break there made the css look flawlessly as I wanted. I usually have no problem styling images and using in the inline-block style on my projects but the break there threw me off guard I suppose. Thank you guys for your help!
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.