Solved

CSS and images

Posted on 2016-09-16
5
101 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 5

Accepted Solution

by:
ResQTek Nancy earned 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need help with this homework problem. 5 58
HTML INPUT 6 19
A responsive image gallery using flexbox 6 21
boostsrap 1 9
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
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…

749 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