?
Solved

CSS and images

Posted on 2016-09-16
5
Medium Priority
?
121 Views
Last Modified: 2016-09-19
Im trying to figure out how to place a circle image on top of a 40px height background color.  The image is 175px high.  No matter what I try, I cannot seem to get it to lay on top of background.  See image for example.

example of end result
0
Comment
Question by:a204801
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 6

Accepted Solution

by:
ResQTek Nancy earned 2000 total points
ID: 41802288
You'll probably want to use two DIV containers with relative positioning to achieve this. One for the rectangle and one for the image. Then you adjust the distance from the top of the page.
Hard to say what you might be doing wrong without your code.
Official reference: http://www.w3schools.com/css/css_positioning.asp

I drew up something really raw in CSS that might help. http://staging.ResQTek.net/overlap.htm
0
 
LVL 19

Expert Comment

by:Montoya
ID: 41802485
the code is helpful, but here's a way to look at it...

you have 40 pix high, but you want something that's 180 pix over it.

If I start with a div at 195 pix, put my image div 10px from top, then I'll have it centered top to bottom.
then, I center my border inside that (obviously the border would go second)
0
 
LVL 22

Expert Comment

by:Kim Walker
ID: 41803328
The code is helpful. It has been said twice already, but it really is.

If you're trying to use z-index to bring the circle image to the top, beware that z-index only applies to positioned elements. You can always enter position: relative; without any top, right, bottom, or left properties in order to avoid moving the image.
#circle-image {
    position: relative;
    z-index: 1000;
}

Open in new window

0
 
LVL 22

Expert Comment

by:Kim Walker
ID: 41803329
Another issue might be whether or not the area outside the circle in your image is white or transparent. Is it a GIF, PNG, or JPG?
0
 

Author Closing Comment

by:a204801
ID: 41805412
exactly what i was looking for!
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question