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.

Positioning Pictures

Featured Replies

I am using Dreamweaver CS4 and I can't seem to figure out how to place and position images where ever I want them? Is there some sort of secret?

 

If anyone can help it would be awesome!

 

Thanks

Do you mean positioning as in aligning them to the left/right/center or positioning as in 50px from the left/250px from the top?

There are many ways to approach this, here's one...

 

Give your image a CSS class name...

 

<img src="myimage.jpg" alt="" class="myimage" />

 

Now write the CSS...

 

.myimage {
float: left; /* aligns left */
margin-top: 250px; /* top margin */
margin-left: 50px; /* left margin */
}

  • Author

Here is a little more detail

 

I am making a contact page, and I have all my contact information on the left and I want to put a question mark image just to the right of the information. When I try to do this is makes gaps in my information, as if the images was pushing the text out of the way and was part of the text.

  • Author
There are many ways to approach this, here's one...

 

Give your image a CSS class name...

 

<img src="myimage.jpg" alt="" class="myimage" />

 

Now write the CSS...

 

.myimage {
float: left; /* aligns left */
margin-top: 250px; /* top margin */
margin-left: 50px; /* left margin */
}

 

 

Thanks you so much, this helped A LOT! I got it to work.

If I need the image to go behind text how to I do that? because right now if I get to close it pushes the text out of the way.

you need to add these css attributes

 

position:relative; (remove it from the document flow, but position it relative to where it occurs, a positioning attribute is required to use the z axis)

 

z-index:-10; (this it's third dimensional or layer position on the page, x is across, y is vertical and z is forwards and backwards - Default is 0 so we need a negative value)

 

Now you can either use the margin properties like you have been doing, or you can make use of the

 

top:

left:

bottom:

right:

 

properties to position it accordingly

 

So something along these lines

 

.myimage {
position:relative; /* Declare how we want to position it, this cancels out the ability to 'float' elements, careful if you're combining relatively positioned elements with floated elements */
top: 250px; /* position relative to the top - y axis */
left: -50px; /* position relative to the left - x axis */
z-index: -10 /* z-axis */
}

  • Author

So messing around with the position stuff you said I found that I had to use "position:absolute" instead of relative.

I don't really know what either one actually does, so if anyone could break it down that would be awesome.

Straight of W3Schools:

 

 

static - Default. An element with position: static always has the position the normal flow of the page gives it (a static element ignores any top, bottom, left, or right declarations)

 

relative - An element with position: relative moves an element relative to its normal position, so "left:20" adds 20 pixels to the element's LEFT position

 

absolute - An element with position: absolute is positioned at the specified coordinates relative to its containing block. The element's position is specified with the "left", "top", "right", and "bottom" properties

 

fixed - An element with position: fixed is positioned at the specified coordinates relative to the browser window. The element's position is specified with the "left", "top", "right", and "bottom" properties. The element remains at that position regardless of scrolling. Works in IE7 (strict mode)

 

Try out some of the Demo's http://www.w3schools.com/Css/pr_class_position.asp

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.