Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Aligning Pictures Inside Container Only?

Featured Replies

When I insert pictures into my CSS they only seem to stack on top of one another leaving a huge gap on the right hand side of my container. How would I be able to move them around?

  • Author

sorry for the wait. basically where it is all stacked up i would like to move the second picture to the right.

Looks like normal document flow. If you want to move them around try giving the parent container a relative position and the images absolute position. Then you can position them using top, right, bottom, left attributes with pixel or percent values. Its a bit complicated to explain positioning. Maybe you can find a tutorial on it?

 

Good luck.

  • Author

Okay yeah I will give it a go. I keep drifting in and out of different ideas at the moment so I'm trying everything at once until I manage to find something that works haha.

 

Thanks a lot. :)

You can float each image either to the left or right so they can be side by side. Just make sure you add overflow to the parent container to contain the floats.

 

Here are some CSS Declarations:

 

 

.arentContainer {

oveflow: hidden;

}

 

 

img {

float: left;

}

 

 

Hope this helps.

You can float each image either to the left or right so they can be side by side. Just make sure you add overflow to the parent container to contain the floats.

 

Here are some CSS Declarations:

 

 

.arentContainer {

oveflow: hidden;

}

 

 

img {

float: left;

}

That's basically OK except that img is an inline element

http://htmlhelp.com/reference/html40/inline.html

so it should be converted to a block element.

Floated elements should have sizes (some modern browsers don't seem to need this), so if your images are different sizes you may have to create classes with fdifferent sizes.

.arentContainer {
oveflow: hidden;
}

img {
float: left; display: block; width: ??px; height: ??px;
}

You may need to add side padding or side margin to keep them apart.

Inline elements (img) are floating by default))))

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.