Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 313569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:07:12+00:00 2026-05-12T08:07:12+00:00

There is a line break between two <img> tags, and they are indented in

  • 0

There is a line break between two <img> tags, and they are indented in the document for nice-formatting.

But I’m using relative positioning and z-order to place one image (part of the layout) overtop of another.

I have something like this

<img style="position: relative; z-index: -1;" width=a height=b>
<img style="position: relative; z-index: 0; left: -a" width=x height=y>

the line break after the first <img> tag adds a space, and then when I set the relative left position of the second <img> tag, that space is taken into consideration and it’s set just a little bit to the right of the first image.

I don’t want to put them on the same line, making the lower image tag a background isn’t an option (it has to be sized), and fiddling with the relative position is out of the question (I’m assuming spaces will be different sizes on different browsers/systems).

Can I make this work?

edit — more info

The spacing is throwing off the relative positioning. Is there no way to just position them absolutely, but to the left and top of another element, which has static positioning?

anyways, the layout in its current state has an image overlapping another image. The overlapped image is a div background and the piece of layout is an image in the div.

I need to change the overlapped image when a link is clicked (a thumbnail of an image is clicked, and a larger version appears in the overlapped image). But the images are all different sizes, larger than the default div background image. I can’t resize a div background so it has to be an image. But the problem is getting one image to overlap another. They want me to also fade between images, so I need two images, stacked on top of each other (with the top one fading in and out to a bottom one), plus the edge of the layout over top of those.

I don’t know how to accomplish this any other way

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:07:13+00:00Added an answer on May 12, 2026 at 8:07 am

    What is that z-order there? its z-index.
    And how will line break within design improve anything.
    As i see things z-index and line breaks in website layout/design are the last things you should use. What you need is proper margins and paddings. Also read about negative margins before you start using z-index.

    Check these out :
    http://www.barelyfitz.com/screencast/html-training/css/positioning/
    http://www.elated.com/articles/css-positioning/
    http://www.smashingmagazine.com/2009/07/27/the-definitive-guide-to-using-negative-margins/
    http://www.smashingmagazine.com/2007/05/01/css-float-theory-things-you-should-know/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to ensure that there's never a line break between a radio button
Is there a way to have \n make a line break in a TextBlock
Is there any way I can detect when a line break has been erased
Is there such a class that provides a page break line? I've been looking
How can I extract the content between tags with several line breaks? I'm a
Is there a way to break the line in a line-chart, if the gap
Please see http://jsfiddle.net/jaWjB/1/ The line break happens in between the second image and its
Is there a possibility to have a visual separator between two lines ( tr
<?xml version=1.0 encoding=utf-8?><items> <item><title>title3</title><desc>This is some desc3</desc></item></items> There is no line break between each
I want to start findBugs on existing project (on command line there are currently

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.