Solved

AP Div Positioning

Posted on 2012-03-13
2
422 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
spacing 5 56
CSS Font Arial Narrow 1 26
Getting Column Height to Match Other Column 5 44
WordPress Themes 10 34
Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…

932 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now