HiveBrain v1.2.0
Get Started
← Back to all entries
patternhtmlModerate

The 101 Pictures Gallery

Submitted by: @import:stackexchange-codereview··
0
Viewed 0 times
gallery101picturesthe

Problem

I am working on a website for a group of artists and want to know of a way to make my code cleaner and my website run faster. I am working on the gallery page, and there are over 100 pictures I want to show. I have been entering them in as shown below, but I know there must be a better way to try and do this, but I just need some help.



/*****
PIC GALLERY
*****/

.gallerySize {
/height: 25%;/
/ overflow-x:30%;/
}
.galleryContainer {
margin-top: 5%;
width: 90%;
overflow-x: scroll;
overflow-y: hidden;
/height: 15%;/
/margin: 2%;/
/height: 10%;/
}
. .galleryContainer img {
height: 171px;
width: 180px;
}
.profile {
margin-top: 5%;
}
.galleryContainer img {
height: 300px;
width: 400px;
}
.fullDrawing img {
height: 117.273px;
width: 1042.273px;
}
.topImg {
margin: 5% 2% 0% 5%;
}
.list-inline {
white-space: nowrap;
}
.galleryContainer > .row [class*="col-lg"],
.galleryContainer > .row [class*="col-md"],
.galleryContainer > .row [class*="col-md"] {
float: none;
display: inline-block;
white-space: normal;
vertical-align: top;
}
#main-content > .row {
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
}





































Solution

Image gallery.

To be completely honest, if you're wanting to make an image gallery, you would save yourself a lot of time and trouble by using Wordpress.org

Example: http://psychoproductions.net/psychographics/

That said...

Assuming your images are stored server-side, and you really want to code this yourself, unless you want to type every image URL one by one, you may want to look into a server side language that can scan through your image folder(s), parse the paths and wrap it into HTML tags. It really varies what you can do depending on your server environment...

A few other things

`

There's no point declaring
class is there is not one to assign to it.

Another example:



alt="..." may as well be left out, if an ellipsis will be its content. Why not class="something meaningful"`?

Context

StackExchange Code Review Q#95395, answer score: 10

Revisions (0)

No revisions yet.