Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CSS and images

Posted on 2016-09-16
5
Medium Priority
?
129 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

604 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