Solved

AP Div Positioning

Posted on 2012-03-13
2
435 Views
Last Modified: 2012-03-13
I am working on a website and trying to position an image to a specific spot. Here is the link to the page I'm testing it on: http://67.199.146.93/~ratamaca/layouttest.html

The menu bar should be tight up against the bottom of the black banner and the red star should be just to the right of the main logo and on top of both the black banner and the blue menu bar - like this test page: http://67.199.146.93/~ratamaca/indextest2.html

The problem with "indextest2" page is that when I resize the browser window, the start moves. So I created "layouttest" using a div for the black banner - setting its position to relative and adding the star div.

I'm new to using div's and positioning - unfortunately I've been using old school tables. I'm working at getting away from that, but at this moment....here I am.

I hope someone can help me out.
0
Comment
Question by:JustDuckyDesigns
[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
2 Comments
 
LVL 12

Accepted Solution

by:
Tony van Schaik earned 500 total points
ID: 37716914
This should work give it a shot:

#apDiv1 {
	position:absolute;
	width:225px;
	height:115px;
	z-index:1;
	margin-left: 820px; /* Instead of Left */
	top: 50px;
}

Open in new window


And an other advice. Don't use images in the layout itself, keep your layout free from images in the HTML. Instead add them in your stylesheet. It's easier to maintain...

Like this for example:
HTML
<div id="apDiv1>
</div>

CSS
#apDiv1 {
        background:url(KatieImages/13yearsstar275.png) no-repeat left top;
	position:absolute;
	width:225px;
	height:115px;
	z-index:1;
	margin-left: 820px; /* Instead of Left */
	top: 50px;
}

Open in new window

0
 

Author Closing Comment

by:JustDuckyDesigns
ID: 37717128
Absolutely perfect! Exactly what I needed and even extra info that was very helpful!
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

739 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